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]