Browse Source

chore: ✏️ Rename settings for default_gid

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

Rename settings in configuration file
fix_mandate_history
Yoann Piétri 5 years ago
committed by klafyvel
parent
commit
faeaeb5491
  1. 3
      re2o/settings_default.py
  2. 3
      re2o/settings_local.example.py
  3. 6
      users/models.py

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

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

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

Loading…
Cancel
Save