8
0
Fork 0
mirror of https://gitlab.federez.net/re2o/re2o synced 2024-06-18 08:38:09 +00:00

Ajout du gid au sérialiser Adherent

This commit is contained in:
grisel-davy 2018-08-04 23:13:01 +02:00 committed by chirac
parent de5b6c903f
commit ded0aadb9d
2 changed files with 6 additions and 1 deletions

View file

@ -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'}
}

View file

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