1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2025-05-17 22:52:46 +00:00

Compare commits

..

No commits in common. "13c815c62c5598a76eab2b2c4e1b85a0e657612d" and "ecf80f8b81a32b895ba17ded259abdfcc1f4c2f4" have entirely different histories.

View File

@ -646,7 +646,7 @@ class Tournament(models.Model):
for line in data: for line in data:
trigram = line[0][-4:-1] trigram = line[0][-4:-1]
participation = self.participations.get(team__trigram=trigram) participation = self.participations.get(team__trigram=trigram)
pool1 = self.pools.get(round=1, participations=participation, room=1) pool1 = self.pools.get(round=1, participations=participation)
tweak1_qs = Tweak.objects.filter(pool=pool1, participation=participation) tweak1_qs = Tweak.objects.filter(pool=pool1, participation=participation)
tweak1_nb = int(line[2]) tweak1_nb = int(line[2])
if not tweak1_nb: if not tweak1_nb:
@ -657,7 +657,7 @@ class Tournament(models.Model):
'participation': participation}) 'participation': participation})
if self.pools.filter(round=2, participations=participation).exists(): if self.pools.filter(round=2, participations=participation).exists():
pool2 = self.pools.get(round=2, participations=participation, room=1) pool2 = self.pools.get(round=2, participations=participation)
tweak2_qs = Tweak.objects.filter(pool=pool2, participation=participation) tweak2_qs = Tweak.objects.filter(pool=pool2, participation=participation)
tweak2_nb = int(line[4]) tweak2_nb = int(line[4])
if not tweak2_nb: if not tweak2_nb:
@ -676,7 +676,7 @@ class Tournament(models.Model):
notes[participation] = note notes[participation] = note
sorted_notes = sorted(notes.items(), key=lambda x: x[1], reverse=True) sorted_notes = sorted(notes.items(), key=lambda x: x[1], reverse=True)
for i, (participation, _note) in enumerate(sorted_notes): for i, (participation, _note) in enumerate(sorted_notes):
mention = mentions[i][3] if len(mentions[i]) >= 4 else "" mention = mentions[i][3]
if not self.final: if not self.final:
participation.mention = mention participation.mention = mention
else: else:
@ -1393,8 +1393,6 @@ class Pool(models.Model):
max_row += 1 max_row += 1
def parse_spreadsheet(self): def parse_spreadsheet(self):
translation.activate('fr')
gc = gspread.service_account_from_dict(settings.GOOGLE_SERVICE_CLIENT) gc = gspread.service_account_from_dict(settings.GOOGLE_SERVICE_CLIENT)
self.tournament.create_spreadsheet() self.tournament.create_spreadsheet()
spreadsheet = gc.open_by_key(self.tournament.notes_sheet_id) spreadsheet = gc.open_by_key(self.tournament.notes_sheet_id)