realm: Enable spectator access by default in development.

Enable spectator access for test `zulip` realm in developement
setup.

Add option in `do_create_realm` to configure
`enable_spectator_access` field of `Realm`.
This commit is contained in:
Aman Agrawal
2021-10-06 17:41:48 +05:30
committed by Tim Abbott
parent 2a922409aa
commit 00d3b88257
4 changed files with 24 additions and 6 deletions

View File

@@ -5067,6 +5067,7 @@ def do_create_realm(
org_type: Optional[int] = None,
date_created: Optional[datetime.datetime] = None,
is_demo_organization: Optional[bool] = False,
enable_spectator_access: Optional[bool] = False,
) -> Realm:
if string_id == settings.SOCIAL_AUTH_SUBDOMAIN:
raise AssertionError("Creating a realm on SOCIAL_AUTH_SUBDOMAIN is not allowed!")
@@ -5089,6 +5090,8 @@ def do_create_realm(
kwargs["plan_type"] = plan_type
if org_type is not None:
kwargs["org_type"] = org_type
if enable_spectator_access is not None:
kwargs["enable_spectator_access"] = enable_spectator_access
if date_created is not None:
# The date_created parameter is intended only for use by test