diff --git a/judge/views/contests.py b/judge/views/contests.py index 9fb4273..f944e11 100644 --- a/judge/views/contests.py +++ b/judge/views/contests.py @@ -153,12 +153,13 @@ class ContestList( if "orgs" in self.request.GET and self.request.profile: try: self.org_query = list(map(int, request.GET.getlist("orgs"))) - self.org_query = [ - i - for i in self.org_query - if i - in self.request.profile.organizations.values_list("id", flat=True) - ] + if not self.request.user.is_superuser: + self.org_query = [ + i + for i in self.org_query + if i + in self.request.profile.organizations.values_list("id", flat=True) + ] except ValueError: pass @@ -228,7 +229,10 @@ class ContestList( context["contest_query"] = self.contest_query context["org_query"] = self.org_query if self.request.profile: - context["organizations"] = self.request.profile.organizations.all() + if self.request.user.is_superuser: + context["organizations"] = Organization.objects.all() + else: + context["organizations"] = self.request.profile.organizations.all() context["page_type"] = "list" context.update(self.get_sort_context()) context.update(self.get_sort_paginate_context())