emile 10 months ago
parent 69cc5b6586
commit 034d53beef

Binary file not shown.

@ -48,6 +48,9 @@ class OnlineUserConsumer(WebsocketConsumer):
online_users_ids = [connection.user.id for connection in online_connections] online_users_ids = [connection.user.id for connection in online_connections]
customer_connections = [] customer_connections = []
staff_connections = [] staff_connections = []
for connection in sorted_connections:
if hasattr(connection.user, 'customerprofile'):
customer_connections.append(connection)
event = { event = {
'type': 'online_user_connection_handler', 'type': 'online_user_connection_handler',
@ -61,7 +64,8 @@ class OnlineUserConsumer(WebsocketConsumer):
def online_user_connection_handler(self, event): def online_user_connection_handler(self, event):
context = { context = {
'staff_connections': event['staff_connections'],
'customer_connections': event['customer_connections'],
} }
html = render_to_string("details_templates/partials/recently-online.html", context=context) html = render_to_string("details_templates/partials/recently-online.html", context=context)
self.send(text_data=json.dumps({ self.send(text_data=json.dumps({

Loading…
Cancel
Save