From 6e517b2dec80a82cbf39323b08a8593584b4c11a Mon Sep 17 00:00:00 2001 From: Rishi Gupta Date: Sat, 5 Nov 2016 16:07:13 -0700 Subject: [PATCH] models.py: Disable unique_open_realm feature when realms have subdomains. --- zerver/models.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/zerver/models.py b/zerver/models.py index 5063201dde..77b9338820 100644 --- a/zerver/models.py +++ b/zerver/models.py @@ -108,8 +108,10 @@ def completely_open(domain): def get_unique_open_realm(): # type: () -> Optional[Realm] - """We only return a realm if there is a unique non-system-only realm - and it is completely open.""" + """We only return a realm if there is a unique non-system-only realm, + it is completely open, and there are no subdomains.""" + if settings.REALMS_HAVE_SUBDOMAINS: + return None realms = Realm.objects.filter(deactivated=False) # On production installations, the (usually "zulip.com") system # realm is an empty realm just used for system bots, so don't