change year to 2026

This commit is contained in:
Kenneth Kehl
2026-01-20 09:49:07 -08:00
parent 1fb1526e99
commit 857d5784af
3 changed files with 19 additions and 10 deletions

View File

@@ -35,11 +35,12 @@ def check_service_over_total_message_limit(key_type, service):
# For now we are using calendar year
# Switch to using service agreement dates when the Agreement model is ready
# If the service stat has never been set before, compute the remaining seconds for 2025
# and set it (all services) to expire on 12/31/2025.
# and set it (all services) to expire on 12/31/2026.
if service_stats is None:
now_et = datetime.now(ZoneInfo("America/New_York"))
target_time = datetime(
2025, 12, 31, 23, 59, 59, tzinfo=ZoneInfo("America/New_York")
2026, 12, 31, 23, 59, 59, tzinfo=ZoneInfo("America/New_York")
)
time_difference = target_time - now_et
seconds_difference = int(time_difference.total_seconds())

View File

@@ -180,7 +180,9 @@ def get_organization_dashboard(organization_id):
organization_id, year, include_all_services=True
)
service_ids = [service_data["service_id"] for service_data in services_with_usage.values()]
service_ids = [
service_data["service_id"] for service_data in services_with_usage.values()
]
if not service_ids:
return jsonify(services=[]), 200
@@ -197,11 +199,13 @@ def get_organization_dashboard(organization_id):
sorted_services = sorted(
services_list,
key=lambda s: (
0 if (s["active"] and not s["restricted"]) else
1 if (s["active"] and s["restricted"]) else
2,
s["service_name"].lower()
)
(
0
if (s["active"] and not s["restricted"])
else 1 if (s["active"] and s["restricted"]) else 2
),
s["service_name"].lower(),
),
)
return jsonify(services=sorted_services)

View File

@@ -1009,10 +1009,14 @@ def test_get_organization_dashboard(admin_request, mocker):
}
}
mock_templates = mocker.patch("app.organization.rest.dao_get_recent_sms_template_per_service")
mock_templates = mocker.patch(
"app.organization.rest.dao_get_recent_sms_template_per_service"
)
mock_templates.return_value = {service_id: "Welcome SMS"}
mock_contacts = mocker.patch("app.organization.rest.dao_get_service_primary_contacts")
mock_contacts = mocker.patch(
"app.organization.rest.dao_get_service_primary_contacts"
)
mock_contacts.return_value = {service_id: "billing@example.com"}
response = admin_request.get(