From faeaeb5491942df067136dcdd9771de7cefa4044 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yoann=20Pi=C3=A9tri?= Date: Wed, 17 Feb 2021 13:05:59 +0100 Subject: [PATCH] chore: :pencil2: Rename settings for default_gid Settings for default_gid is now DEFAULT_GID instead of LDAP['default_gid'] Rename settings in configuration file --- re2o/settings_default.py | 3 +++ re2o/settings_local.example.py | 3 +++ users/models.py | 6 +++--- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/re2o/settings_default.py b/re2o/settings_default.py index 8b3cfa34..fae7d4a1 100644 --- a/re2o/settings_default.py +++ b/re2o/settings_default.py @@ -54,6 +54,9 @@ UID_RANGES = {"users": [21001, 30000], "service-users": [20000, 21000]} # A range of GID to use. Used in linux environement GID_RANGES = {"posix": [501, 600]} +# Default gid +DEFAULT_GID = 500 + # If you want to add a database routers, please fill in above and add your databse. # Then, add a file "local_routers.py" in folder app re2o, and add your router path in # the LOCAL_ROUTERS var as "re2o.local_routers.DbRouter". You can also add extra routers. diff --git a/re2o/settings_local.example.py b/re2o/settings_local.example.py index 2a199bbd..ef5b3f43 100644 --- a/re2o/settings_local.example.py +++ b/re2o/settings_local.example.py @@ -103,6 +103,9 @@ UID_RANGES = {"users": [21001, 30000], "service-users": [20000, 21000]} # A range of GID to use. Used in linux environement GID_RANGES = {"posix": [501, 600]} +# Default gid +DEFAULT_GID = 500 + # If you want to add a database routers, please fill in above and add your databse. # Then, add a file "local_routers.py" in folder app re2o, and add your router path in # the LOCAL_ROUTERS var as "re2o.local_routers.DbRouter". You can also add extra routers. diff --git a/users/models.py b/users/models.py index ca8f3084..2861c655 100755 --- a/users/models.py +++ b/users/models.py @@ -78,7 +78,7 @@ from re2o.base import smtp_check from re2o.field_permissions import FieldPermissionModelMixin from re2o.mail_utils import send_mail from re2o.mixins import AclMixin, RevMixin -from re2o.settings import GID_RANGES, LDAP, UID_RANGES +from re2o.settings import GID_RANGES, DEFAULT_GID, UID_RANGES from users import signals # General utilities @@ -426,7 +426,7 @@ class User( Returns: gid (int): Default gid number """ - return int(LDAP["user_gid"]) + return DEFAULT_GID @cached_property def gid(self): @@ -439,7 +439,7 @@ class User( Returns: gid (int): Default gid number """ - return LDAP["user_gid"] + return DEFAULT_GID @cached_property def is_class_club(self):