From ded0aadb9d13cd629cda6c0511dd88ec7cb58c5e Mon Sep 17 00:00:00 2001 From: grisel-davy Date: Sat, 4 Aug 2018 23:13:01 +0200 Subject: [PATCH] =?UTF-8?q?Ajout=20du=20gid=20au=20s=C3=A9rialiser=20Adher?= =?UTF-8?q?ent?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/serializers.py | 2 +- users/models.py | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/api/serializers.py b/api/serializers.py index 4d406898..2e938a35 100644 --- a/api/serializers.py +++ b/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'} } diff --git a/users/models.py b/users/models.py index bceb84bb..f3e786c0 100755 --- a/users/models.py +++ b/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