Fix contest submission bug when modifying from admin page
This commit is contained in:
parent
167fa1ad66
commit
ad974530d5
1 changed files with 5 additions and 0 deletions
|
@ -206,6 +206,11 @@ class SubmissionAdmin(admin.ModelAdmin):
|
||||||
"problem__code",
|
"problem__code",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def save_model(self, request, obj, form, change):
|
||||||
|
super().save_model(request, obj, form, change)
|
||||||
|
if "case_points" in form.changed_data or "case_total" in form.changed_data:
|
||||||
|
obj.update_contest()
|
||||||
|
|
||||||
def judge(self, request, queryset):
|
def judge(self, request, queryset):
|
||||||
if not request.user.has_perm(
|
if not request.user.has_perm(
|
||||||
"judge.rejudge_submission"
|
"judge.rejudge_submission"
|
||||||
|
|
Loading…
Reference in a new issue