From ecf80f8b81a32b895ba17ded259abdfcc1f4c2f4 Mon Sep 17 00:00:00 2001 From: Emmy D'Anello Date: Sat, 20 Apr 2024 16:16:50 +0200 Subject: [PATCH] Use french translation when submitting notes to Google Sheets Signed-off-by: Emmy D'Anello --- participation/models.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/participation/models.py b/participation/models.py index c442aca..1ef9104 100644 --- a/participation/models.py +++ b/participation/models.py @@ -1372,6 +1372,8 @@ class Pool(models.Model): worksheet.client.batch_update(spreadsheet.id, body) def update_juries_lines_spreadsheet(self): + translation.activate('fr') + gc = gspread.service_account_from_dict(settings.GOOGLE_SERVICE_CLIENT) spreadsheet = gc.open_by_key(self.tournament.notes_sheet_id) worksheet = spreadsheet.worksheet(f"Poule {self.short_name}") @@ -1759,6 +1761,8 @@ class Note(models.Model): if not self.has_any_note(): return + translation.activate('fr') + gc = gspread.service_account_from_dict(settings.GOOGLE_SERVICE_CLIENT) passage = Passage.objects.prefetch_related('pool__tournament', 'pool__participations').get(pk=self.passage.pk) spreadsheet_id = passage.pool.tournament.notes_sheet_id