From 1ccb94206a0a07e1357a09520952aa38a0236d6d Mon Sep 17 00:00:00 2001 From: emile Date: Fri, 14 Jun 2024 00:31:00 +0300 Subject: [PATCH] nerw --- osinaweb/osinacore/custom_context.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/osinaweb/osinacore/custom_context.py b/osinaweb/osinacore/custom_context.py index 60c6aa87..a4d2c563 100644 --- a/osinaweb/osinacore/custom_context.py +++ b/osinaweb/osinacore/custom_context.py @@ -65,14 +65,10 @@ def utilities(request): total_tasks = open_task_count + working_on_task_count - # Get the current time - current_time = timezone.now() - - # Calculate the datetime of 24 hours ago - twenty_four_hours_ago = current_time - timezone.timedelta(hours=24) + today = datetime.now().date() # Fetch the latest statuses from the last 24 hours - latest_statuses = Status.objects.filter(date__gte=twenty_four_hours_ago).order_by('-id') + latest_statuses = Status.objects.filter(date=today).order_by('-id') # Calculate time ago for each status and store it in a dictionary latest_statuses_time_ago = [{'status': status, 'time_ago': calculate_time_ago(status)} for status in latest_statuses]