From 6661c297fa3c6e9b7c5d4ca61d46bc69e165fc59 Mon Sep 17 00:00:00 2001 From: Keshav Priyadarshi Date: Mon, 12 Oct 2026 18:36:02 +0530 Subject: [PATCH 1/3] fix: deactivate user timezone after serving request Signed-off-by: Keshav Priyadarshi --- vulnerabilities/middleware/timezone.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) 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 From 427ce5ec526bc3e8134fa001ed96cf4677b536e8 Mon Sep 17 00:00:00 2001 From: Keshav Priyadarshi Date: Mon, 12 Oct 2026 18:38:12 +0530 Subject: [PATCH 2/3] fix: add the tzdata dependency Signed-off-by: Keshav Priyadarshi --- requirements-dev.txt | 1 + requirements.txt | 1 + setup.cfg | 1 + 3 files changed, 3 insertions(+) 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 From 92149d0267a1e364515933fb3a70b0ebef5fb650 Mon Sep 17 00:00:00 2001 From: Keshav Priyadarshi Date: Mon, 12 Oct 2026 23:19:26 +0530 Subject: [PATCH 3/3] fix: use consistent datetime formatting Signed-off-by: Keshav Priyadarshi --- vulnerabilities/templates/pipeline_dashboard.html | 2 +- vulnerabilities/templates/pipeline_run_details.html | 6 +++--- vulnerabilities/templates/pipeline_run_list.html | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) 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 %}