Fix admin bug
This commit is contained in:
parent
e6a4519291
commit
88c1f6324d
1 changed files with 2 additions and 4 deletions
|
@ -247,9 +247,7 @@ class ContestAdmin(CompareVersionAdmin):
|
||||||
readonly += ["access_code"]
|
readonly += ["access_code"]
|
||||||
if not request.user.has_perm("judge.create_private_contest"):
|
if not request.user.has_perm("judge.create_private_contest"):
|
||||||
readonly += [
|
readonly += [
|
||||||
"is_private",
|
|
||||||
"private_contestants",
|
"private_contestants",
|
||||||
"is_organization_private",
|
|
||||||
"organizations",
|
"organizations",
|
||||||
]
|
]
|
||||||
if not request.user.has_perm("judge.change_contest_visibility"):
|
if not request.user.has_perm("judge.change_contest_visibility"):
|
||||||
|
@ -264,8 +262,8 @@ class ContestAdmin(CompareVersionAdmin):
|
||||||
"judge.change_contest_visibility"
|
"judge.change_contest_visibility"
|
||||||
):
|
):
|
||||||
if (
|
if (
|
||||||
not form.cleaned_data["is_private"]
|
not len(form.cleaned_data["organizations"]) > 0
|
||||||
and not form.cleaned_data["is_organization_private"]
|
and not len(form.cleaned_data["private_contestants"]) > 0
|
||||||
):
|
):
|
||||||
raise PermissionDenied
|
raise PermissionDenied
|
||||||
if not request.user.has_perm("judge.create_private_contest"):
|
if not request.user.has_perm("judge.create_private_contest"):
|
||||||
|
|
Loading…
Reference in a new issue