diff --git a/requirements-dev.txt b/requirements-dev.txt index 75966c993..78cfafa37 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -154,6 +154,7 @@ typecode==30.2.0 typecode-libmagic==5.39.210531 typing_extensions==4.13.0 tzlocal==5.3.1 +tzdata==2026.5 univers==32.0.1 uritemplate==4.2.0 urllib3==2.6.3 diff --git a/requirements.txt b/requirements.txt index 6cbf5c520..a00d8935f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -81,6 +81,7 @@ typecode==30.2.0 typecode-libmagic==5.39.210531 typing_extensions==4.13.0 tzlocal==5.3.1 +tzdata==2026.5 univers==32.0.1 uritemplate==4.2.0 urllib3==2.6.3 diff --git a/setup.cfg b/setup.cfg index 51fd18dec..a4ae10cee 100644 --- a/setup.cfg +++ b/setup.cfg @@ -66,6 +66,7 @@ install_requires = django-environ==0.11.2 gunicorn==23.0.0 django-altcha==0.2.0 + tzdata==2026.5 # for the API doc drf-spectacular[sidecar]==0.24.2 diff --git a/vulnerabilities/middleware/timezone.py b/vulnerabilities/middleware/timezone.py index 93c7c5eaa..445b37dd7 100644 --- a/vulnerabilities/middleware/timezone.py +++ b/vulnerabilities/middleware/timezone.py @@ -17,14 +17,18 @@ def __init__(self, get_response): self.get_response = get_response def __call__(self, request): - try: - # Activate local timezone for user using cookies - tzname = request.COOKIES.get("user_timezone") - if tzname: + tzname = request.COOKIES.get("user_timezone") + if tzname: + try: timezone.activate(zoneinfo.ZoneInfo(tzname)) - else: + except Exception as e: timezone.deactivate() - except Exception as e: + else: + timezone.deactivate() + + try: + response = self.get_response(request) + finally: timezone.deactivate() - return self.get_response(request) + return response diff --git a/vulnerabilities/templates/pipeline_dashboard.html b/vulnerabilities/templates/pipeline_dashboard.html index 905b57bd0..04068b0a9 100644 --- a/vulnerabilities/templates/pipeline_dashboard.html +++ b/vulnerabilities/templates/pipeline_dashboard.html @@ -161,7 +161,7 @@

Pipeline Dashboard

{% if schedule.latest_run_end_date %} - {{ schedule.latest_run_end_date|date:"Y-m-d h:i a T" }} + {{ schedule.latest_run_end_date|date:"Y-m-d h:i A T" }} {% else %} N/A {% endif %} diff --git a/vulnerabilities/templates/pipeline_run_details.html b/vulnerabilities/templates/pipeline_run_details.html index 94730308c..5128f08c3 100644 --- a/vulnerabilities/templates/pipeline_run_details.html +++ b/vulnerabilities/templates/pipeline_run_details.html @@ -79,7 +79,7 @@

{{ pipeline_name }} Run Log

Start

{% if run.run_start_date %} - {{ run.run_start_date|date:"Y-m-d h:i a T" }} + {{ run.run_start_date|date:"Y-m-d h:i A T" }} {% else %} N/A {% endif %} @@ -89,7 +89,7 @@

{{ pipeline_name }} Run Log

End

{% if run.run_end_date %} - {{ run.run_end_date|date:"Y-m-d h:i a T" }} + {{ run.run_end_date|date:"Y-m-d h:i A T" }} {% else %} N/A {% endif %} @@ -97,7 +97,7 @@

{{ pipeline_name }} Run Log

Created

-

{{ run.created_date|date:"Y-m-d h:i a T" }}

+

{{ run.created_date|date:"Y-m-d h:i A T" }}

Version

diff --git a/vulnerabilities/templates/pipeline_run_list.html b/vulnerabilities/templates/pipeline_run_list.html index 72e6e767b..9076ecfa8 100644 --- a/vulnerabilities/templates/pipeline_run_list.html +++ b/vulnerabilities/templates/pipeline_run_list.html @@ -95,14 +95,14 @@

{{ pipeline_name }} Runs

{% if run.run_start_date %} - {{ run.run_start_date|date:"Y-m-d h:i a T" }} + {{ run.run_start_date|date:"Y-m-d h:i A T" }} {% else %} N/A {% endif %}
{% if run.run_end_date %} - {{ run.run_end_date|date:"Y-m-d h:i a T" }} + {{ run.run_end_date|date:"Y-m-d h:i A T" }} {% else %} N/A {% endif %}