diff --git a/draw/consumers.py b/draw/consumers.py index d64c888..7719b8d 100644 --- a/draw/consumers.py +++ b/draw/consumers.py @@ -9,6 +9,7 @@ from random import randint, shuffle from asgiref.sync import sync_to_async from channels.generic.websocket import AsyncJsonWebsocketConsumer from django.conf import settings +from django.contrib.auth.models import User from django.contrib.contenttypes.models import ContentType from django.utils import translation from django.utils.translation import gettext_lazy as _ @@ -44,6 +45,8 @@ class DrawConsumer(AsyncJsonWebsocketConsumer): We accept only if this is a user of a team of the associated tournament, or a volunteer of the tournament. """ + if '_fake_user_id' in self.scope['session']: + self.scope['user'] = await User.objects.aget(pk=self.scope['session']['_fake_user_id']) # Fetch the registration of the current user user = self.scope['user']