File 0001-Fixed-an-issue-when-uploading-a-CSV.patch of Package pgadmin4

From 444a364a8d96ecebab2969e2c0a9b4a36b6e6357 Mon Sep 17 00:00:00 2001
From: Rahul Shirsat <rahul.shirsat@enterprisedb.com>
Date: Fri, 4 Feb 2022 15:10:13 +0530
Subject: [PATCH] Fixed an issue when uploading a CSV throwing an error in the
 Desktop mode. Fixes #7150

---
 docs/en_US/release_notes_6_5.rst          | 1 +
 web/pgadmin/misc/file_manager/__init__.py | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)

#diff --git a/docs/en_US/release_notes_6_5.rst b/docs/en_US/release_notes_6_5.rst
#index 4f3650387..fda1187cd 100644
#--- a/docs/en_US/release_notes_6_5.rst
#+++ b/docs/en_US/release_notes_6_5.rst
#@@ -35,4 +35,5 @@ Bug fixes
# | `Issue #7142 <https://redmine.postgresql.org/issues/7142>`_ -  Fixed an issue where a warning message was shown after database creation/modification.
# | `Issue #7145 <https://redmine.postgresql.org/issues/7145>`_ -  Ensure that owner should be ignored while comparing extensions.
# | `Issue #7146 <https://redmine.postgresql.org/issues/7146>`_ -  Fixed event trigger comparing issue in Schema Diff tool.
#+| `Issue #7150 <https://redmine.postgresql.org/issues/7150>`_ -  Fixed an issue when uploading a CSV throwing an error in the Desktop mode.
# | `Issue #7151 <https://redmine.postgresql.org/issues/7151>`_ -  Fixed value error in the restore dialog.
diff --git a/web/pgadmin/misc/file_manager/__init__.py b/web/pgadmin/misc/file_manager/__init__.py
index db5f0b6d4..d132e46eb 100644
--- a/web/pgadmin/misc/file_manager/__init__.py
+++ b/web/pgadmin/misc/file_manager/__init__.py
@@ -984,7 +984,8 @@ def add(self, req=None):
 
             try:
                 # Check if the new file is inside the users directory
-                pathlib.Path(new_name).relative_to(the_dir)
+                if config.SERVER_MODE:
+                    pathlib.Path(new_name).relative_to(the_dir)
             except ValueError as _:
                 return self.ERROR_NOT_ALLOWED
 
openSUSE Build Service is sponsored by