|
|
|
@ -107,7 +107,7 @@ class TicketRoomConsumer(WebsocketConsumer):
|
|
|
|
|
|
|
|
|
|
def update_handler(self, event):
|
|
|
|
|
update_id = event['update_id']
|
|
|
|
|
update = TicketUpdate.objects.get(id=update_id)
|
|
|
|
|
update = TicketUpdate.objects.get(id=update_id) #No need for serialize because in the context of the method not in the event data
|
|
|
|
|
context = {
|
|
|
|
|
'update': update,
|
|
|
|
|
'user': self.user
|
|
|
|
@ -186,7 +186,7 @@ class TicketRoomConsumer(WebsocketConsumer):
|
|
|
|
|
'image': conn.user.staffprofile.image.url if hasattr(conn.user, 'staffprofile') and conn.user.staffprofile.image else None,
|
|
|
|
|
'date': conn.date.isoformat() if conn.date else None,
|
|
|
|
|
} for conn in connections
|
|
|
|
|
]
|
|
|
|
|
] #Everything included in a webscoket's event data needs to be serialized
|
|
|
|
|
}
|
|
|
|
|
async_to_sync(self.channel_layer.group_send)(
|
|
|
|
|
self.ticket_number, event
|
|
|
|
|