ldap: Make Zulip compatible with django-auth-ldap==1.5.

In version 1.5, get_or_create_user method is not used. It exists just
for the compatibility. The main function to use now is
get_or_build_user.

See the changelog:
https://django-auth-ldap.readthedocs.io/en/latest/changes.html#id1

Fixes #9307
This commit is contained in:
Umair Khan
2018-05-22 11:33:56 +05:00
committed by Tim Abbott
parent 03eb17c02f
commit f38d6ac6fe
5 changed files with 19 additions and 20 deletions

View File

@@ -423,7 +423,7 @@ class ZulipLDAPAuthBackend(ZulipLDAPAuthBackendBase):
except ZulipLDAPException:
return None # nocoverage # TODO: this may no longer be possible
def get_or_create_user(self, username: str, ldap_user: _LDAPUser) -> Tuple[UserProfile, bool]:
def get_or_build_user(self, username: str, ldap_user: _LDAPUser) -> Tuple[UserProfile, bool]:
if settings.LDAP_EMAIL_ATTR is not None:
# Get email from ldap attributes.