fix superuser contest search
This commit is contained in:
parent
2ee279098f
commit
8e6bcd90af
1 changed files with 11 additions and 7 deletions
|
@ -153,6 +153,7 @@ class ContestList(
|
|||
if "orgs" in self.request.GET and self.request.profile:
|
||||
try:
|
||||
self.org_query = list(map(int, request.GET.getlist("orgs")))
|
||||
if not self.request.user.is_superuser:
|
||||
self.org_query = [
|
||||
i
|
||||
for i in self.org_query
|
||||
|
@ -228,6 +229,9 @@ class ContestList(
|
|||
context["contest_query"] = self.contest_query
|
||||
context["org_query"] = self.org_query
|
||||
if self.request.profile:
|
||||
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())
|
||||
|
|
Loading…
Reference in a new issue