Fix GSheet parser

Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
This commit is contained in:
Emmy D'Anello 2024-07-06 10:08:38 +02:00
parent 9721898731
commit 2e99b3ea8e
Signed by: ynerant
GPG Key ID: 3A75C55819C8CF85
1 changed files with 3 additions and 3 deletions

View File

@ -1227,7 +1227,7 @@ class Pool(models.Model):
worksheets = spreadsheet.worksheets()
if f"{_('Pool')} {self.short_name}" not in [ws.title for ws in worksheets]:
worksheet = spreadsheet.add_worksheet(f"{_('Pool')} {self.short_name}",
30, 2 + pool_size * passage_width)
30, 2 + passages.count() * passage_width)
else:
worksheet = spreadsheet.worksheet(f"{_('Pool')} {self.short_name}")
if any(ws.title == "Sheet1" for ws in worksheets):
@ -1594,7 +1594,7 @@ class Pool(models.Model):
spreadsheet = gc.open_by_key(self.tournament.notes_sheet_id)
worksheet = spreadsheet.worksheet(f"{_('Pool')} {self.short_name}")
average_cell = worksheet.find(_("Average"))
average_cell = worksheet.find(str(_("Average")))
min_row = 5
max_row = average_cell.row - 1
juries_visible = worksheet.get(f"A{min_row}:B{max_row}")
@ -1616,7 +1616,7 @@ class Pool(models.Model):
spreadsheet = gc.open_by_key(self.tournament.notes_sheet_id)
worksheet = spreadsheet.worksheet(f"{_('Pool')} {self.short_name}")
average_cell = worksheet.find(_("Average"))
average_cell = worksheet.find(str(_("Average")))
min_row = 5
max_row = average_cell.row - 2
data = worksheet.get_values(f"A{min_row}:AH{max_row}")