From 08ce3916111b06a80d7721c0fa414fc3e47b4604 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Thu, 3 Nov 2016 12:33:46 -0700 Subject: [PATCH] register: Fix using subdomains logic when subdomains is disabled. --- zerver/views/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zerver/views/__init__.py b/zerver/views/__init__.py index b851014d62..a0a300c106 100644 --- a/zerver/views/__init__.py +++ b/zerver/views/__init__.py @@ -118,7 +118,7 @@ def accounts_register(request): # realm. domain = prereg_user.realm.domain realm = get_realm(domain) - else: + elif settings.REALMS_HAVE_SUBDOMAINS: subdomain_realm = resolve_subdomain_to_realm(get_subdomain(request)) domain = resolve_email_to_domain(email) domain = subdomain_realm.domain if subdomain_realm else domain @@ -135,6 +135,9 @@ def accounts_register(request): return render_to_response("zerver/completely_open_link.html", ctx) else: realm = get_realm(domain) + else: + domain = resolve_email_to_domain(email) + realm = get_realm(domain) if realm and realm.deactivated: