diff --git a/participation/models.py b/participation/models.py index a6b0094..1aab4ca 100644 --- a/participation/models.py +++ b/participation/models.py @@ -1254,6 +1254,10 @@ class Pool(models.Model): passage_width = 6 + (2 if has_observer else 0) passages = self.passages.all() + if not pool_size or not passages.count(): + # Not initialized yet + return + # Create tournament sheet if it does not exist self.tournament.create_spreadsheet() @@ -1623,6 +1627,10 @@ class Pool(models.Model): worksheet.client.batch_update(spreadsheet.id, body) def update_juries_lines_spreadsheet(self): + if not self.participations.count() or not self.passages.count(): + # Not initialized yet + return + translation.activate(settings.PREFERRED_LANGUAGE_CODE) gc = gspread.service_account_from_dict(settings.GOOGLE_SERVICE_CLIENT)