check_subdomain: Remove case for user_subdomain being None.

With REALMS_HAVE_SUBDOMAINS always on, user_subdomain is never None,
so this was just dead code.
This commit is contained in:
Tim Abbott 2017-10-18 22:28:17 -07:00
parent b850875840
commit 4ddb812354
2 changed files with 1 additions and 4 deletions

View File

@ -95,7 +95,6 @@ not_yet_fully_covered = {
'zerver/lib/sqlalchemy_utils.py',
'zerver/lib/str_utils.py',
'zerver/lib/stream_recipient.py',
'zerver/lib/subdomains.py',
'zerver/lib/tex.py',
'zerver/lib/timeout.py',
'zerver/lib/unminify.py',

View File

@ -25,10 +25,8 @@ def is_subdomain_root_or_alias(request):
return not subdomain or subdomain in settings.ROOT_SUBDOMAIN_ALIASES
def check_subdomain(realm_subdomain, user_subdomain):
# type: (Optional[Text], Optional[Text]) -> bool
# type: (Optional[Text], Text) -> bool
if realm_subdomain is not None:
if (realm_subdomain == "" and user_subdomain is None):
return True
if realm_subdomain != user_subdomain:
return False
return True