diff --git a/osinaweb/db.sqlite3 b/osinaweb/db.sqlite3 index fdf06ea1..47991b88 100644 Binary files a/osinaweb/db.sqlite3 and b/osinaweb/db.sqlite3 differ diff --git a/osinaweb/support/__pycache__/consumers.cpython-310.pyc b/osinaweb/support/__pycache__/consumers.cpython-310.pyc index 39ccef52..5b5d13e9 100644 Binary files a/osinaweb/support/__pycache__/consumers.cpython-310.pyc and b/osinaweb/support/__pycache__/consumers.cpython-310.pyc differ diff --git a/osinaweb/support/consumers.py b/osinaweb/support/consumers.py index dfda7ed2..99cdc3a5 100644 --- a/osinaweb/support/consumers.py +++ b/osinaweb/support/consumers.py @@ -170,16 +170,17 @@ class TicketRoomConsumer(WebsocketConsumer): def modify_online_user(self): connections = TicketConnection.objects.filter(ticket=self.ticket, terminated_at__isnull=True) + sorted_connections = list(connections) online_connections = [] - for connection in connections: - connection_data = { + for connection in sorted_connections: + if hasattr(connection.user, 'customerprofile'): + connection_data = { 'first_name': connection.user.first_name, 'last_name': connection.user.last_name, - } - online_connections.append(connection_data) - + } + online_connections.append(connection_data) event = { - 'type': 'user_connection_handler', + 'type': 'online_user_connection_handler', 'user': self.user, 'connections': online_connections, } @@ -187,7 +188,7 @@ class TicketRoomConsumer(WebsocketConsumer): self.ticket_number, event ) - def user_connection_handler(self, event): + def online_user_connection_handler(self, event): context = { 'connections': event['connections'], 'user': event['user']