Skip to content

Commit

Permalink
this will not break trust me lad
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonLovesDoggo authored Mar 6, 2024
1 parent 215c4ce commit 67006e2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions gameserver/views/contest.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,16 +181,16 @@ def get_title(self):
def get_queryset(self):
cache_key = f"contest_{self.kwargs['slug']}_scoreboard"
queryset = cache.get(cache_key)
if not queryset or request.GET.get('cache_reset', '').casefold() == "yaaaa":
if not queryset or self.request.GET.get('cache_reset', '').casefold() == "yaaaa":
queryset = self.object.ranks().prefetch_related('team', 'submissions__problem')
cache.set(cache_key, queryset, 5 * 5) # Cache for 5 minutes (300 seconds)
return queryset

@staticmethod
@staticmethod``
def _get_contest(slug):
cache_key = f"contest_{slug}_scoreboard_contest"
contest = cache.get(cache_key)
if not contest or request.GET.get('cache_reset', ''.casefold()) == "yaaaa":
if not contest or self.request.GET.get('cache_reset', '').casefold() == "yaaaa":
contest = get_object_or_404(models.Contest, slug=slug)
cache.set(cache_key, contest, 5 * 5) # Cache for 5 minutes (300 seconds)
return contest
Expand Down

0 comments on commit 67006e2

Please sign in to comment.