From b4679d78ed539847a0f9acf3b7acf34a3d059e5e Mon Sep 17 00:00:00 2001 From: albertoleoncio Date: Tue, 19 Nov 2024 14:13:02 -0300 Subject: [PATCH] fix: Optimize evaluation handling by directly updating last evaluation for locked edits --- contests/handlers/triage.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/contests/handlers/triage.py b/contests/handlers/triage.py index 67ec35a..e8d50ed 100644 --- a/contests/handlers/triage.py +++ b/contests/handlers/triage.py @@ -186,13 +186,12 @@ def unhold_edit(self): ) for locked in lockeds: - diff = Edit.objects.get(contest=self.contest, diff=locked.diff) evaluation = Evaluation.objects.create( contest=self.contest, - diff=diff, + diff=Edit.objects.get(contest=self.contest, diff=locked.diff), status='0' # Status '0' indicates the edit is pending ) - diff.update(last_evaluation=evaluation) + Edit.objects.filter(contest=self.contest, diff=locked.diff).update(last_evaluation=evaluation) return lockeds