Revert to apline:3.11 to stay on Python 3.7 (3.8 has issues with channels)

This commit is contained in:
Eliot Berriot 2020-02-18 15:19:51 +01:00
parent 9a2876469a
commit 14d5b0c69c
No known key found for this signature in database
GPG key ID: 6B501DFD73514E14
5 changed files with 39 additions and 5 deletions

View file

@ -14,7 +14,11 @@ class JsonAuthConsumer(JsonWebsocketConsumer):
def accept(self):
super().accept()
for group in self.groups:
channels.group_add(group, self.channel_name)
for group in self.scope["user"].get_channels_groups():
groups = self.scope["user"].get_channels_groups() + self.groups
for group in groups:
channels.group_add(group, self.channel_name)
def disconnect(self, close_code):
groups = self.scope["user"].get_channels_groups() + self.groups
for group in groups:
channels.group_discard(group, self.channel_name)