mirror of
https://github.com/zulip/zulip.git
synced 2025-11-10 17:07:07 +00:00
ldap: Use a cleaner super().authenticate() call in ZulipLDAPAuthBackend.
This commit is contained in:
committed by
Tim Abbott
parent
c0980e3e9e
commit
2a473c57f4
@@ -534,7 +534,7 @@ class ZulipLDAPAuthBackend(ZulipLDAPAuthBackendBase):
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# We want to apss the user's LDAP username into
|
# We want to pass the user's LDAP username into
|
||||||
# authenticate() below. If an email address was entered
|
# authenticate() below. If an email address was entered
|
||||||
# in the login form, we need to use
|
# in the login form, we need to use
|
||||||
# django_to_ldap_username to translate the email address
|
# django_to_ldap_username to translate the email address
|
||||||
@@ -551,10 +551,7 @@ class ZulipLDAPAuthBackend(ZulipLDAPAuthBackendBase):
|
|||||||
# against the LDAP database, and assuming those are correct,
|
# against the LDAP database, and assuming those are correct,
|
||||||
# end up calling `self.get_or_build_user` with the
|
# end up calling `self.get_or_build_user` with the
|
||||||
# authenticated user's data from LDAP.
|
# authenticated user's data from LDAP.
|
||||||
return ZulipLDAPAuthBackendBase.authenticate(self,
|
return super().authenticate(request=None, username=username, password=password)
|
||||||
request=None,
|
|
||||||
username=username,
|
|
||||||
password=password)
|
|
||||||
|
|
||||||
def get_or_build_user(self, username: str, ldap_user: _LDAPUser) -> Tuple[UserProfile, bool]:
|
def get_or_build_user(self, username: str, ldap_user: _LDAPUser) -> Tuple[UserProfile, bool]:
|
||||||
"""The main function of our authentication backend extension of
|
"""The main function of our authentication backend extension of
|
||||||
|
|||||||
Reference in New Issue
Block a user