From d0b6b5084f55fd821f1582e6c3d27b1abaede765 Mon Sep 17 00:00:00 2001 From: Nathaniel Kim Date: Mon, 28 Dec 2020 18:54:54 -0800 Subject: [PATCH] Properly handle the first successful submission --- backend/api/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/api/views.py b/backend/api/views.py index 8bb0cdc3..b659fd0d 100644 --- a/backend/api/views.py +++ b/backend/api/views.py @@ -762,7 +762,7 @@ def compilation_update(self, request, team, league_id, pk=None): # Only if this submission is newer than what's already been processed, # update the submission history. # (to prevent reverting to older submissions that took longer to process) - if submission.id > team_sub.last_1_id: + if team_sub.last_1_id is None or submission.id > team_sub.last_1_id: team_sub.last_3_id = team_sub.last_2_id team_sub.last_2_id = team_sub.last_1_id team_sub.last_1_id = submission