game: fix: game is spectable by non authentified user

This commit is contained in:
starnakin 2024-01-18 13:37:51 +01:00
parent 371aa85b4c
commit fa38ba6eb8

View File

@ -27,8 +27,8 @@ class GameWebSocket(WebsocketConsumer):
def connect(self):
self.user: User = self.scope["user"]
if (self.user.is_anonymous or not self.user.is_authenticated):
return
if (self.user.pk is None):
self.user.pk = 0
self.channel_layer.group_add(self.group_name, self.channel_name)