Skip to content

Commit

Permalink
Fix cache bug on szkopul (#406)
Browse files Browse the repository at this point in the history
  • Loading branch information
MasloMaslane authored Nov 21, 2024
1 parent 04823a6 commit 7ba096d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions oioioi/problems/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,7 @@ def filter_my_all_visible_submissions(request, queryset):

result = Submission.objects.none()
resolved = set()
prev_contest = request.contest

for submission in queryset:
pi = submission.problem_instance
Expand All @@ -434,5 +435,8 @@ def filter_my_all_visible_submissions(request, queryset):
request, current_queryset
)
result = result.union(current_queryset)
if hasattr(request, '_cache'): # Delete cache so that e.g. `is_contest_basicadmin` doesn't return wrong results
delattr(request, '_cache')
request.contest = prev_contest

return result

0 comments on commit 7ba096d

Please sign in to comment.