pycodestyle

This commit is contained in:
jonaswinkler
2021-01-26 15:43:07 +01:00
parent 313f2886d7
commit 3b5d55c428
2 changed files with 7 additions and 5 deletions

View File

@@ -7,10 +7,12 @@ from channels.generic.websocket import WebsocketConsumer
class StatusConsumer(WebsocketConsumer):
def connect(self):
self.accept()
async_to_sync(self.channel_layer.group_add)('status_updates', self.channel_name)
async_to_sync(self.channel_layer.group_add)(
'status_updates', self.channel_name)
def disconnect(self, close_code):
async_to_sync(self.channel_layer.group_discard)('status_updates', self.channel_name)
async_to_sync(self.channel_layer.group_discard)(
'status_updates', self.channel_name)
def status_update(self, event):
self.send(json.dumps(event['data']))