settings: Include units in SERVER_UPGRADE_NAG_DEADLINE_DAYS name.

When naming things with units of time involved, it's always good to
include units in the name, so that the meaning is clear.
This commit is contained in:
Tim Abbott
2021-04-27 17:15:16 -07:00
parent feabccfaf4
commit 05f2ebb2b8
3 changed files with 5 additions and 3 deletions

View File

@@ -61,7 +61,9 @@ def is_outdated_server(user_profile: Optional[UserProfile]) -> bool:
).replace(tzinfo=pytz.utc)
version_no_newer_than = min(LAST_SERVER_UPGRADE_TIME, release_build_time)
deadline = version_no_newer_than + datetime.timedelta(days=settings.SERVER_UPGRADE_NAG_DEADLINE)
deadline = version_no_newer_than + datetime.timedelta(
days=settings.SERVER_UPGRADE_NAG_DEADLINE_DAYS
)
if user_profile is None or not user_profile.is_realm_admin:
# Administrators get warned at the deadline; all users 30 days later.

View File

@@ -876,7 +876,7 @@ class HomeTest(ZulipTestCase):
compute_navbar_logo_url(page_params), "/static/images/logo/zulip-org-logo.svg?version=0"
)
@override_settings(SERVER_UPGRADE_NAG_DEADLINE=365)
@override_settings(SERVER_UPGRADE_NAG_DEADLINE_DAYS=365)
def test_is_outdated_server(self) -> None:
# Check when server_upgrade_nag_deadline > last_server_upgrade_time
hamlet = self.example_user("hamlet")

View File

@@ -446,4 +446,4 @@ DEFAULT_DATA_EXPORT_IMPORT_PARALLELISM = (len(os.sched_getaffinity(0)) // 2) or
# to be upgraded because of likely security releases in the meantime.
# Default is 18 months, constructed as 12 months before someone should
# upgrade, plus 6 months for the system administrator to get around to it.
SERVER_UPGRADE_NAG_DEADLINE = 30 * 18
SERVER_UPGRADE_NAG_DEADLINE_DAYS = 30 * 18