main
emile 11 months ago
parent d18ea0bac2
commit 2619112708

BIN
.DS_Store vendored

Binary file not shown.

BIN
osinaweb/.DS_Store vendored

Binary file not shown.

@ -831,14 +831,12 @@ def get_latest_activities(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]

Loading…
Cancel
Save