From 857d5784afee662714db774bc8a17e2ae62c8108 Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Tue, 20 Jan 2026 09:49:07 -0800 Subject: [PATCH] change year to 2026 --- app/notifications/validators.py | 5 +++-- app/organization/rest.py | 16 ++++++++++------ tests/app/organization/test_rest.py | 8 ++++++-- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/app/notifications/validators.py b/app/notifications/validators.py index 8358b3c8a..d6302f0f7 100644 --- a/app/notifications/validators.py +++ b/app/notifications/validators.py @@ -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()) diff --git a/app/organization/rest.py b/app/organization/rest.py index 13a488c20..be7d890b6 100644 --- a/app/organization/rest.py +++ b/app/organization/rest.py @@ -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) diff --git a/tests/app/organization/test_rest.py b/tests/app/organization/test_rest.py index f0e0770d0..a9516986a 100644 --- a/tests/app/organization/test_rest.py +++ b/tests/app/organization/test_rest.py @@ -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(