mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2025-04-26 15:32:37 +00:00
Don't generate spreadhseet if there is no team in a pool
This commit is contained in:
parent
f3bd479fdc
commit
032b67ac51
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user