1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2024-12-24 17:42:23 +00:00

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

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}")