mirror of
https://github.com/zulip/zulip.git
synced 2026-07-15 21:03:26 +08:00
subdomains: Simplify is_subdomain_root_or_alias.
This logic is equivalent, though it takes a couple of readings to convince oneself of that. This version should then be easier to reason about.
This commit is contained in:
parent
69e44a68fc
commit
cc32634439
@ -23,9 +23,7 @@ def get_subdomain(request):
|
||||
|
||||
def is_subdomain_root_or_alias(request):
|
||||
# type: (HttpRequest) -> bool
|
||||
subdomain = _extract_subdomain(request)
|
||||
return (subdomain == Realm.SUBDOMAIN_FOR_ROOT_DOMAIN
|
||||
or subdomain in settings.ROOT_SUBDOMAIN_ALIASES)
|
||||
return get_subdomain(request) == Realm.SUBDOMAIN_FOR_ROOT_DOMAIN
|
||||
|
||||
def user_matches_subdomain(realm_subdomain, user_profile):
|
||||
# type: (Optional[Text], UserProfile) -> bool
|
||||
|
||||
Loading…
Reference in New Issue
Block a user