1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2024-12-26 07:42:26 +00:00

Fix tournament prefetch related in GSheet notifications

Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
This commit is contained in:
Emmy D'Anello 2024-04-07 00:21:20 +02:00
parent 29d9432ca2
commit 188b83ce2d
Signed by: ynerant
GPG Key ID: 3A75C55819C8CF85

View File

@ -1885,7 +1885,7 @@ class GSheetNotificationsView(View):
if not await Tournament.objects.filter(pk=kwargs['pk']).aexists(): if not await Tournament.objects.filter(pk=kwargs['pk']).aexists():
return HttpResponse(status=404) return HttpResponse(status=404)
tournament = await Tournament.objects.prefetch_related('participations', 'pools').aget(pk=kwargs['pk']) tournament = await Tournament.objects.prefetch_related('participation_set', 'pools').aget(pk=kwargs['pk'])
expected_channel_id = sha1(f"{tournament.name}-{timezone.now().date()}-{request.site.domain}".encode()) \ expected_channel_id = sha1(f"{tournament.name}-{timezone.now().date()}-{request.site.domain}".encode()) \
.hexdigest() .hexdigest()