From 695d4e648cd4cd3a086b407e471932537a793d4b Mon Sep 17 00:00:00 2001 From: Murtuza Zabuawala Date: Tue, 13 Mar 2018 07:55:37 -0400 Subject: [PATCH] Fix template path generation for Windows. Fixes #3139 --- web/pgadmin/utils/compile_template_name.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/web/pgadmin/utils/compile_template_name.py b/web/pgadmin/utils/compile_template_name.py index 1e0b94fa6..1232b6a09 100644 --- a/web/pgadmin/utils/compile_template_name.py +++ b/web/pgadmin/utils/compile_template_name.py @@ -11,10 +11,13 @@ 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 +25,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