mirror of https://github.com/zulip/zulip.git
subdomain: Remove impossible None case from user_matches_subdomain.
The only two callers pass get_subdomain(request) which can’t be None. Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
parent
ea6f18bb46
commit
61e149dbb5
|
@ -1,6 +1,5 @@
|
|||
import re
|
||||
import urllib
|
||||
from typing import Optional
|
||||
|
||||
from django.conf import settings
|
||||
from django.http import HttpRequest
|
||||
|
@ -46,9 +45,7 @@ def is_subdomain_root_or_alias(request: HttpRequest) -> bool:
|
|||
return get_subdomain(request) == Realm.SUBDOMAIN_FOR_ROOT_DOMAIN
|
||||
|
||||
|
||||
def user_matches_subdomain(realm_subdomain: Optional[str], user_profile: UserProfile) -> bool:
|
||||
if realm_subdomain is None:
|
||||
return True # nocoverage # This state may no longer be possible.
|
||||
def user_matches_subdomain(realm_subdomain: str, user_profile: UserProfile) -> bool:
|
||||
return user_profile.realm.subdomain == realm_subdomain
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue