mirror of https://github.com/zulip/zulip.git
settings: Add constant for demo org deadlines.
We set the 30 days deadline timedelta for demo orgs as a constant in default_settings.py so that it can be overridden in tests.
This commit is contained in:
parent
787f22a692
commit
f5c26990c2
|
@ -4964,7 +4964,7 @@ def do_create_realm(
|
|||
realm = Realm(string_id=string_id, name=name, **kwargs)
|
||||
if is_demo_organization:
|
||||
realm.demo_organization_scheduled_deletion_date = (
|
||||
realm.date_created + datetime.timedelta(days=30)
|
||||
realm.date_created + datetime.timedelta(days=settings.DEMO_ORG_DEADLINE_DAYS)
|
||||
)
|
||||
realm.save()
|
||||
|
||||
|
|
|
@ -5180,7 +5180,9 @@ class UserSignUpTest(InviteUserBase):
|
|||
assert user_profile is not None
|
||||
self.assert_logged_in_user_id(user_profile.id)
|
||||
|
||||
expected_deletion_date = realm.date_created + datetime.timedelta(days=30)
|
||||
expected_deletion_date = realm.date_created + datetime.timedelta(
|
||||
days=settings.DEMO_ORG_DEADLINE_DAYS
|
||||
)
|
||||
self.assertEqual(realm.demo_organization_scheduled_deletion_date, expected_deletion_date)
|
||||
|
||||
|
||||
|
|
|
@ -266,6 +266,9 @@ OPEN_REALM_CREATION = False
|
|||
# purpose now that the REALMS_HAVE_SUBDOMAINS migration is finished.
|
||||
SYSTEM_ONLY_REALMS = {"zulip"}
|
||||
|
||||
# Default deadline for demo organizations
|
||||
DEMO_ORG_DEADLINE_DAYS = 30
|
||||
|
||||
# Alternate hostnames to serve particular realms on, in addition to
|
||||
# their usual subdomains. Keys are realm string_ids (aka subdomains),
|
||||
# and values are alternate hosts.
|
||||
|
|
Loading…
Reference in New Issue