home: Redirect https://selfhosting.zuliphostname/ to /serverlogin/.

This is a reasonable default page to render for that hostname, and
less confusing than "Organization does not exist."
This commit is contained in:
Alex Vandiver
2024-01-11 22:57:38 +00:00
committed by Tim Abbott
parent adf9e8de3d
commit b10c611840
2 changed files with 8 additions and 0 deletions

View File

@@ -5,6 +5,7 @@ from typing import List, Optional, Tuple
from django.conf import settings
from django.http import HttpRequest, HttpResponse
from django.shortcuts import redirect, render
from django.urls import reverse
from django.utils.cache import patch_cache_control
from zerver.actions.user_settings import do_change_tos_version, do_change_user_setting
@@ -156,6 +157,8 @@ def home(request: HttpRequest) -> HttpResponse:
if subdomain == settings.SOCIAL_AUTH_SUBDOMAIN:
return redirect(settings.ROOT_DOMAIN_URI)
elif subdomain == settings.SELF_HOSTING_MANAGEMENT_SUBDOMAIN:
return redirect(reverse("remote_billing_legacy_server_login"))
realm = get_realm_from_request(request)
if realm is None:
return render(request, "zerver/invalid_realm.html", status=404)