From aac4fc59e62c94bfeee47c4b54340c6fa0475338 Mon Sep 17 00:00:00 2001 From: Emmy D'Anello Date: Sat, 6 Apr 2024 19:16:32 +0200 Subject: [PATCH] Fix parsing tweaks Signed-off-by: Emmy D'Anello --- participation/models.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/participation/models.py b/participation/models.py index fde6946..f32a697 100644 --- a/participation/models.py +++ b/participation/models.py @@ -607,12 +607,20 @@ class Tournament(models.Model): worksheet.client.batch_update(spreadsheet.id, body) def parse_tweaks_spreadskeets(self): + if not self.pools.exists(): + # Draw has not been done yet + return + gc = gspread.service_account_from_dict(settings.GOOGLE_SERVICE_CLIENT) spreadsheet = gc.open_by_key(self.notes_sheet_id) worksheet = spreadsheet.worksheet("Classement final") score_cell = worksheet.find("Score") max_row = score_cell.row - 3 + if max_row == 1: + # There is no team + return + data = worksheet.get_values(f"A2:E{max_row}") for line in data: trigram = line[0][-4:-1]