From dc8cbc697638fef35734891eac30a6676d4adcea Mon Sep 17 00:00:00 2001 From: cuom1999 Date: Wed, 20 Jul 2022 15:06:15 +0700 Subject: [PATCH] Auto add editing user to curators --- judge/admin/problem.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/judge/admin/problem.py b/judge/admin/problem.py index 0cab70a..53db1d8 100644 --- a/judge/admin/problem.py +++ b/judge/admin/problem.py @@ -346,6 +346,13 @@ class ProblemAdmin(CompareVersionAdmin): ): self._rescore(request, obj.id) + def save_related(self, request, form, formsets, change): + super().save_related(request, form, formsets, change) + # Only rescored if we did not already do so in `save_model` + obj = form.instance + obj.curators.add(request.profile) + obj.save() + def construct_change_message(self, request, form, *args, **kwargs): if form.cleaned_data.get("change_message"): return form.cleaned_data["change_message"]