mirror of
https://github.com/zulip/zulip.git
synced 2025-11-20 06:28:23 +00:00
EmailAuthBackend: Convert a return to assert for a now-impossible case.
This commit is contained in:
@@ -339,10 +339,10 @@ class EmailAuthBackend(ZulipAuthMixin):
|
|||||||
return_data: Optional[Dict[str, Any]]=None) -> Optional[UserProfile]:
|
return_data: Optional[Dict[str, Any]]=None) -> Optional[UserProfile]:
|
||||||
""" Authenticate a user based on email address as the user name. """
|
""" Authenticate a user based on email address as the user name. """
|
||||||
if username is None or password is None:
|
if username is None or password is None:
|
||||||
# Return immediately. Otherwise we will look for a SQL row with
|
# Because of how we structure our auth calls to always
|
||||||
# NULL username. While that's probably harmless, it's needless
|
# specify which backend to use when not using
|
||||||
# exposure.
|
# EmailAuthBackend, username and password should always be set.
|
||||||
return None
|
raise AssertionError("Invalid call to authenticate for EmailAuthBackend")
|
||||||
|
|
||||||
user_profile = common_get_active_user_by_email(username, return_data=return_data)
|
user_profile = common_get_active_user_by_email(username, return_data=return_data)
|
||||||
if user_profile is None:
|
if user_profile is None:
|
||||||
|
|||||||
Reference in New Issue
Block a user