From a198af8690a67232368768c189102d188ae74276 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Wed, 22 Nov 2023 14:50:43 +0100 Subject: [PATCH] fix: set tz only when needed --- website/web/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/website/web/__init__.py b/website/web/__init__.py index d8e8a086..fe13bec1 100644 --- a/website/web/__init__.py +++ b/website/web/__init__.py @@ -869,10 +869,11 @@ def index_generic(show_hidden: bool=False, show_error: bool=True, category: Opti cut_time: Optional[datetime] = None if time_delta_on_index: # We want to filter the captures on the index - cut_time = (datetime.now() - timedelta(**time_delta_on_index)).replace(tzinfo=timezone.utc) + cut_time = (datetime.now() - timedelta(**time_delta_on_index)) + cut_time_with_tz = cut_time.replace(tzinfo=timezone.utc) for cached in lookyloo.sorted_capture_cache(index_cut_time=cut_time): - if cut_time and cached.timestamp < cut_time: + if cut_time and cached.timestamp < cut_time_with_tz: continue if category: