8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-12-23 07:23:46 +00:00

chore: ✏️ Rename settings for default_gid

Settings for default_gid is now DEFAULT_GID instead of LDAP['default_gid']

Rename settings in configuration file
This commit is contained in:
Yoann Pétri 2021-02-17 13:05:59 +01:00 committed by klafyvel
parent 3b6af9d01a
commit faeaeb5491
3 changed files with 9 additions and 3 deletions

View file

@ -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.

View file

@ -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.

View file

@ -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):