Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

settings: Include units in SERVER_UPGRADE_NAG_DEADLINE_DAYS name.

Tim Abbott05f2ebb2b8aa
diff --git a/zerver/lib/home.py b/zerver/lib/home.py
index 5998dd71e69..6d742ef48be 100644
--- a/zerver/lib/home.py
+++ b/zerver/lib/home.py
@@ -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.
diff --git a/zerver/tests/test_home.py b/zerver/tests/test_home.py
index 176d0fb1cc0..06738062090 100644
--- a/zerver/tests/test_home.py
+++ b/zerver/tests/test_home.py
@@ -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")
diff --git a/zproject/default_settings.py b/zproject/default_settings.py
index 70810909511..6581979cf72 100644
--- a/zproject/default_settings.py
+++ b/zproject/default_settings.py
@@ -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