Commit 14bed41d authored by Baptiste Jonglez's avatar Baptiste Jonglez
Browse files

Merge branch 'fix_mail_ldap'

parents 3cba4ffe f6e56b3a
......@@ -171,7 +171,9 @@ class Member(CoinLdapSyncMixin, AbstractUser):
# Do not perform LDAP query if no usefull fields to update are specified
# in update_fields
# Ex : at login, last_login field is updated by django auth module.
if update_fields and set(['username', 'last_name', 'first_name']).isdisjoint(set(update_fields)):
relevant_fields = {'username', 'last_name', 'first_name',
'organization_name', 'email'}
if update_fields and relevant_fields.isdisjoint(set(update_fields)):
return
# Fail if no username specified
......@@ -217,6 +219,7 @@ class Member(CoinLdapSyncMixin, AbstractUser):
# Make sure password is hashed
ldap_user.password = utils.ldap_hash(self._password_ldap)
ldap_user.mail = self.email
# Store SSH keys
ldap_user.sshPublicKey = self.get_ssh_keys()
......@@ -402,6 +405,9 @@ class LdapUser(ldapdb.models.Model):
password = CharField(db_column=b'userPassword', max_length=255)
uidNumber = IntegerField(db_column=b'uidNumber', unique=True)
gidNumber = IntegerField(db_column=b'gidNumber', default=2000)
# Used by Sympa for logging in.
mail = CharField(db_column=b'mail', max_length=255, blank=True,
unique=True)
homeDirectory = CharField(db_column=b'homeDirectory', max_length=255,
default='/tmp')
loginShell = CharField(db_column=b'loginShell', max_length=255,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment