Fix GSheet parser
Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
This commit is contained in:
parent
9721898731
commit
2e99b3ea8e
|
@ -1227,7 +1227,7 @@ class Pool(models.Model):
|
||||||
worksheets = spreadsheet.worksheets()
|
worksheets = spreadsheet.worksheets()
|
||||||
if f"{_('Pool')} {self.short_name}" not in [ws.title for ws in worksheets]:
|
if f"{_('Pool')} {self.short_name}" not in [ws.title for ws in worksheets]:
|
||||||
worksheet = spreadsheet.add_worksheet(f"{_('Pool')} {self.short_name}",
|
worksheet = spreadsheet.add_worksheet(f"{_('Pool')} {self.short_name}",
|
||||||
30, 2 + pool_size * passage_width)
|
30, 2 + passages.count() * passage_width)
|
||||||
else:
|
else:
|
||||||
worksheet = spreadsheet.worksheet(f"{_('Pool')} {self.short_name}")
|
worksheet = spreadsheet.worksheet(f"{_('Pool')} {self.short_name}")
|
||||||
if any(ws.title == "Sheet1" for ws in worksheets):
|
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)
|
spreadsheet = gc.open_by_key(self.tournament.notes_sheet_id)
|
||||||
worksheet = spreadsheet.worksheet(f"{_('Pool')} {self.short_name}")
|
worksheet = spreadsheet.worksheet(f"{_('Pool')} {self.short_name}")
|
||||||
|
|
||||||
average_cell = worksheet.find(_("Average"))
|
average_cell = worksheet.find(str(_("Average")))
|
||||||
min_row = 5
|
min_row = 5
|
||||||
max_row = average_cell.row - 1
|
max_row = average_cell.row - 1
|
||||||
juries_visible = worksheet.get(f"A{min_row}:B{max_row}")
|
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)
|
spreadsheet = gc.open_by_key(self.tournament.notes_sheet_id)
|
||||||
worksheet = spreadsheet.worksheet(f"{_('Pool')} {self.short_name}")
|
worksheet = spreadsheet.worksheet(f"{_('Pool')} {self.short_name}")
|
||||||
|
|
||||||
average_cell = worksheet.find(_("Average"))
|
average_cell = worksheet.find(str(_("Average")))
|
||||||
min_row = 5
|
min_row = 5
|
||||||
max_row = average_cell.row - 2
|
max_row = average_cell.row - 2
|
||||||
data = worksheet.get_values(f"A{min_row}:AH{max_row}")
|
data = worksheet.get_values(f"A{min_row}:AH{max_row}")
|
||||||
|
|
Loading…
Reference in New Issue