mirror of
https://github.com/zulip/zulip.git
synced 2025-11-16 11:52:01 +00:00
auth: Ensure a realm can't be created on SOCIAL_AUTH_SUBDOMAIN.
This commit is contained in:
committed by
Tim Abbott
parent
f5b5ca6928
commit
f064e3ebac
@@ -4973,6 +4973,8 @@ def do_create_realm(
|
||||
date_created: Optional[datetime.datetime] = None,
|
||||
is_demo_organization: Optional[bool] = False,
|
||||
) -> Realm:
|
||||
if string_id == settings.SOCIAL_AUTH_SUBDOMAIN:
|
||||
raise AssertionError("Creating a realm on SOCIAL_AUTH_SUBDOMAIN is not allowed!")
|
||||
if Realm.objects.filter(string_id=string_id).exists():
|
||||
raise AssertionError(f"Realm {string_id} already exists!")
|
||||
if not server_initialized():
|
||||
|
||||
Reference in New Issue
Block a user