From 16a0950f63594d6f26ce7ab218f6ccb222e573dc Mon Sep 17 00:00:00 2001 From: San Lin Naing Date: Mon, 10 Jul 2023 22:02:21 +0900 Subject: [PATCH] Fix an issue where adding a sub-folder inside a folder is not working as expected. #6544 --- web/pgadmin/misc/file_manager/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/web/pgadmin/misc/file_manager/__init__.py b/web/pgadmin/misc/file_manager/__init__.py index f02dd45ed91..b94c974fd0c 100644 --- a/web/pgadmin/misc/file_manager/__init__.py +++ b/web/pgadmin/misc/file_manager/__init__.py @@ -947,6 +947,8 @@ def get_new_name(in_dir, path, name): new_name = name count = 0 while True: + if not (path.endswith("/") or name.startswith("/")): + path = path + "/" file_path = "{}{}/".format(path, new_name) create_path = file_path if in_dir != "":