Browse Source

Merge branch 'home' into 'dev'

Ajout du gid au sérialiser Adherent util pour la création des home

See merge request federez/re2o!217
hotfix-158
chirac 7 years ago
parent
commit
62d86be364
  1. 2
      api/serializers.py
  2. 5
      users/models.py

2
api/serializers.py

@ -547,7 +547,7 @@ class AdherentSerializer(NamespacedHMSerializer):
fields = ('name', 'surname', 'pseudo', 'email', 'local_email_redirect',
'local_email_enabled', 'school', 'shell', 'comment',
'state', 'registered', 'telephone', 'room', 'solde',
'access', 'end_access', 'uid', 'api_url')
'access', 'end_access', 'uid', 'api_url','gid')
extra_kwargs = {
'shell': {'view_name': 'shell-detail'}
}

5
users/models.py

@ -349,6 +349,11 @@ class User(RevMixin, FieldPermissionModelMixin, AbstractBaseUser,
""" Renvoie seulement le nom"""
return self.surname
@cached_property
def gid(self):
"""return the default gid of user"""
return LDAP['user_gid']
@property
def get_shell(self):
""" A utiliser de préférence, prend le shell par défaut

Loading…
Cancel
Save