Skip to content

Commit

Permalink
(no-ticket) Allow superusers bypass ONLY_DEFAULT_CONTEST
Browse files Browse the repository at this point in the history
Change-Id: I43c968a759ffa838f5d307a32036fb7d88d6c1fc
  • Loading branch information
Wojciech Dubiel authored and Paweł Dietrich committed Aug 9, 2023
1 parent 61d3556 commit 4c6a4c4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion oioioi/contestexcl/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ def _default_selector(user, contest):
user, contest
) and selector(user, contest)

if settings.ONLY_DEFAULT_CONTEST:
if settings.ONLY_DEFAULT_CONTEST and \
(request.user is None or not request.user.is_superuser):
qs = [Contest.objects.get(id=settings.DEFAULT_CONTEST)]
else:
qs = ExclusivenessConfig.objects.get_active(
Expand Down

0 comments on commit 4c6a4c4

Please sign in to comment.