Fix template paths for Windows. Fixes #3139

Joint work from Joao and Murtuza.
This commit is contained in:
Dave Page
2018-03-13 12:45:14 -04:00
parent 9365ab62fe
commit 156b308fd3
4 changed files with 50 additions and 22 deletions

View File

@@ -11,10 +11,12 @@ import os
def compile_template_name(
template_prefix, template_file_name, server_type, version):
return os.path.join(
compile_template_path(template_prefix, server_type, version),
template_file_name
)
# Template path concatenation should be same as
# Ref: ../pgadmin4/web/pgadmin/utils/versioned_template_loader.py +54
# to avoid path mismatch in windows
return compile_template_path(template_prefix, server_type, version) + \
'/' + template_file_name
def compile_template_path(template_prefix, server_type, version):
@@ -22,4 +24,8 @@ def compile_template_path(template_prefix, server_type, version):
version_path = '#{0}#{1}#'.format(server_type, version)
else:
version_path = '#{0}#'.format(version)
return os.path.join(template_prefix, version_path)
# Template path concatenation should be same as
# Ref: ../pgadmin4/web/pgadmin/utils/versioned_template_loader.py +54
# to avoid path mismatch in windows
return template_prefix + '/' + version_path