From 65dcc978c1a092685f32310b010b2cb2c26e6a52 Mon Sep 17 00:00:00 2001 From: Emmy D'Anello Date: Sat, 6 Apr 2024 10:38:09 +0200 Subject: [PATCH] Don't parse spreadsheet if there is no spreadsheet Signed-off-by: Emmy D'Anello --- participation/management/commands/parse_notation_sheets.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/participation/management/commands/parse_notation_sheets.py b/participation/management/commands/parse_notation_sheets.py index 0fbb33d..0bc7822 100644 --- a/participation/management/commands/parse_notation_sheets.py +++ b/participation/management/commands/parse_notation_sheets.py @@ -26,6 +26,12 @@ class Command(BaseCommand): if options['verbosity'] >= 1: self.stdout.write(f"Parsing notation sheet for {tournament}") + if not tournament.notes_sheet_id: + if options['verbosity'] >= 1: + self.stdout.write( + self.style.WARNING(f"No spreadsheet found for {tournament}. Please create it first")) + continue + pools = tournament.pools.all() if options['round']: pools = pools.filter(round=options['round'])