8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-12 21:06:27 +00:00

No harcoded var

This commit is contained in:
Gabriel Detraz 2018-08-31 13:35:33 +02:00
parent 0ffdde5a6a
commit 48773668d1

View file

@ -571,11 +571,13 @@ class User(RevMixin, FieldPermissionModelMixin, AbstractBaseUser,
try:
user_ldap = LdapUser.objects.get(uidNumber=self.uid_number)
except LdapUser.DoesNotExist:
if self.state != 3:
user_ldap = LdapUser(uidNumber=self.uid_number)
base = True
access_refresh = True
mac_refresh = True
# Freshly created users are NOT synced in ldap base
if self.state == self.STATE_NOT_YET_ACTIVE:
return
user_ldap = LdapUser(uidNumber=self.uid_number)
base = True
access_refresh = True
mac_refresh = True
if base:
user_ldap.name = self.pseudo
user_ldap.sn = self.pseudo