mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2024-12-24 18:22:24 +00:00
Don't use Google Sheets in tests (for now)
Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
This commit is contained in:
parent
bf5c673739
commit
779aec5e55
@ -3,6 +3,7 @@
|
||||
|
||||
from collections import OrderedDict
|
||||
import json
|
||||
import os
|
||||
from random import randint, shuffle
|
||||
|
||||
from asgiref.sync import sync_to_async
|
||||
@ -990,6 +991,8 @@ 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
|
||||
|
@ -1,6 +1,8 @@
|
||||
# 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
|
||||
@ -399,6 +401,8 @@ 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
|
||||
|
Loading…
Reference in New Issue
Block a user