1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2025-02-24 14:21:19 +00:00

Compare commits

..

No commits in common. "c4ec6a6f2990171e8c7268673e4111c3bd1e4965" and "bf5c673739f0e317238b6a38f7ab34368518a74b" have entirely different histories.

3 changed files with 9 additions and 12 deletions

View File

@ -3,7 +3,6 @@
from collections import OrderedDict
import json
import os
from random import randint, shuffle
from asgiref.sync import sync_to_async
@ -991,8 +990,6 @@ class DrawConsumer(AsyncJsonWebsocketConsumer):
if await pool.is_exportable():
await pool.export()
# Update Google Sheets final sheet
if os.getenv('GOOGLE_PRIVATE_KEY_ID', None):
await sync_to_async(self.tournament.update_ranking_spreadsheet)()
@ensure_orga

View File

@ -1,8 +1,6 @@
# Copyright (C) 2023 by Animath
# SPDX-License-Identifier: GPL-3.0-or-later
import os
from asgiref.sync import sync_to_async
from django.conf import settings
from django.core.validators import MaxValueValidator, MinValueValidator
@ -401,8 +399,6 @@ class Pool(models.Model):
passage.observer = tds[line[3]].participation
await passage.asave()
# Update Google Sheets
if os.getenv('GOOGLE_PRIVATE_KEY_ID', None):
await sync_to_async(self.associated_pool.update_spreadsheet)()
return self.associated_pool

View File

@ -1269,9 +1269,13 @@ class Pool(models.Model):
max_row = average_cell.row - 1
juries_visible = worksheet.get(f"A{min_row}:B{max_row}")
juries_visible = [t for t in juries_visible if t and len(t) == 2]
for i, (jury_name, jury_id) in enumerate(juries_visible):
rows_to_delete = []
for i, (_jury_name, jury_id) in enumerate(juries_visible):
if not jury_id.isnumeric() or int(jury_id) not in self.juries.values_list("id", flat=True):
print(f"Warning: {jury_name} ({jury_id}) appears on the sheet but is not part of the jury.")
rows_to_delete.append(min_row + i)
for row_to_delete in rows_to_delete:
worksheet.delete_rows(row_to_delete)
max_row -= len(rows_to_delete)
for jury in self.juries.all():
if str(jury.id) not in list(map(lambda x: x[1], juries_visible)):