summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--backend/helpers.py12
1 files changed, 5 insertions, 7 deletions
diff --git a/backend/helpers.py b/backend/helpers.py
index 0c1ba6b1..e2385506 100644
--- a/backend/helpers.py
+++ b/backend/helpers.py
@@ -96,11 +96,6 @@ def get_user_owner(file_path) -> str:
return pwd.getpwuid(os.stat(file_path).st_uid).pw_name
-# Get the user group of the given file path.
-def get_user_group(file_path) -> str:
- return grp.getgrgid(os.stat(file_path).st_gid).gr_name
-
-
# Deprecated
def set_user_group() -> str:
return get_user_group()
@@ -112,8 +107,11 @@ def get_user_group_id() -> int:
# Get the group of the user hosting the plugin loader
-def get_user_group() -> str:
- return grp.getgrgid(get_user_group_id()).gr_name
+def get_user_group(file_path) -> str:
+ if file_path:
+ return grp.getgrgid(os.stat(file_path).st_gid).gr_name
+ else:
+ return grp.getgrgid(get_user_group_id()).gr_name
# Get the default home path unless a user is specified