From 88c1f6324d83685f9ac06ebc99e36fd790e3abe3 Mon Sep 17 00:00:00 2001 From: cuom1999 Date: Tue, 6 Sep 2022 15:36:02 -0500 Subject: [PATCH] Fix admin bug --- judge/admin/contest.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/judge/admin/contest.py b/judge/admin/contest.py index e63bf78..3ccad04 100644 --- a/judge/admin/contest.py +++ b/judge/admin/contest.py @@ -247,9 +247,7 @@ class ContestAdmin(CompareVersionAdmin): readonly += ["access_code"] if not request.user.has_perm("judge.create_private_contest"): readonly += [ - "is_private", "private_contestants", - "is_organization_private", "organizations", ] if not request.user.has_perm("judge.change_contest_visibility"): @@ -264,8 +262,8 @@ class ContestAdmin(CompareVersionAdmin): "judge.change_contest_visibility" ): if ( - not form.cleaned_data["is_private"] - and not form.cleaned_data["is_organization_private"] + not len(form.cleaned_data["organizations"]) > 0 + and not len(form.cleaned_data["private_contestants"]) > 0 ): raise PermissionDenied if not request.user.has_perm("judge.create_private_contest"):