Skip to content

Commit

Permalink
Update leaderboard fix - no longer 500s
Browse files Browse the repository at this point in the history
  • Loading branch information
TheOriginalSoni committed Oct 30, 2024
1 parent ae660e1 commit 4ae69f0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion myus/myus/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from django.template.loader import render_to_string
from django.views.decorators.csrf import csrf_exempt
from django.core.exceptions import PermissionDenied
from datetime import timedelta

import django.urls as urls
import django.forms as forms
Expand Down Expand Up @@ -212,7 +213,7 @@ def leaderboard(request, hunt_id: int, slug: Optional[str] = None):
created_or_start=Greatest(F("creation_time"), hunt.start_time),
solve_time=Greatest(
Coalesce(F("last_solve"), F("created_or_start")) - F("created_or_start"),
0,
timedelta(seconds=0),
output_field=DurationField(),
),
)
Expand Down

0 comments on commit 4ae69f0

Please sign in to comment.