From 4439dbf7817f35073c66689338a74a43d8e01095 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Tue, 24 Oct 2017 14:05:50 -0700 Subject: [PATCH] log_into_subdomain: Fix realm creation on servers using an IP address. While it's totally fine to put a leading '.' before the cookie domain for normal hostnames and browsers will just strip them, if you're using an IP address, it doesn't work, because .127.0.0.1 (for example) is just invalid, and the cookie won't be set. This fixes an issue where after installing with an IP address, realm creation would end with being stuck at a blank page for /accounts/login/subdomain/. --- zerver/views/registration.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zerver/views/registration.py b/zerver/views/registration.py index fa1b7a412d..69195c63e9 100644 --- a/zerver/views/registration.py +++ b/zerver/views/registration.py @@ -52,7 +52,7 @@ def redirect_and_log_into_subdomain(realm, full_name, email_address, reverse('zerver.views.auth.log_into_subdomain') ]) - domain = '.' + settings.EXTERNAL_HOST.split(':')[0] + domain = settings.EXTERNAL_HOST.split(':')[0] response = redirect(subdomain_login_uri) data = {'name': full_name, 'email': email_address, 'subdomain': realm.subdomain,