mirror of
https://github.com/MarcZierle/photo-log-backend.git
synced 2025-01-06 06:27:57 +00:00
24 lines
457 B
Python
24 lines
457 B
Python
|
from channels.generic.websocket import JsonWebsocketConsumer
|
||
|
|
||
|
|
||
|
class NotificationsConsumer(JsonWebsocketConsumer):
|
||
|
groups = ['notifications']
|
||
|
|
||
|
def connect(self):
|
||
|
self.accept()
|
||
|
|
||
|
|
||
|
def disconnect(self, close_code):
|
||
|
pass
|
||
|
|
||
|
|
||
|
def receive_json(self, content):
|
||
|
pass
|
||
|
|
||
|
|
||
|
def task_finished(self, event):
|
||
|
self.send_json({
|
||
|
'type': event['description'],
|
||
|
'content': event['content']
|
||
|
})
|