mirror of
https://github.com/GSA/notifications-api.git
synced 2026-07-10 11:23:55 -04:00
change year to 2026
This commit is contained in:
@@ -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())
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user