From d98aa34e1454d49a8c9d0e43d69fc2fc38c16970 Mon Sep 17 00:00:00 2001 From: Kumi Date: Thu, 28 Nov 2024 18:35:45 +0100 Subject: [PATCH] fix: Fix timestamp filtering inconsistency Corrects the timestamp comparison in the status filtering logic by using the adjusted datetime object for accurate filtering, ensuring list results reflect intended timestamp boundaries. --- mood/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mood/views.py b/mood/views.py index 7605045..6f32479 100644 --- a/mood/views.py +++ b/mood/views.py @@ -56,7 +56,7 @@ class StatusListView(LoginRequiredMixin, ListView): if "to" in self.request.GET: to_timestamp = datetime.strptime(self.request.GET["to"], "%Y-%m-%d") to_timestamp = to_timestamp.replace(hour=23, minute=59, second=59) - status_list = status_list.filter(timestamp__lte=self.request.GET["to"]) + status_list = status_list.filter(timestamp__lte=to_timestamp) return status_list