diff --git a/osinaweb/db.sqlite3 b/osinaweb/db.sqlite3 index 0465e4ac..6fd2c2d8 100644 Binary files a/osinaweb/db.sqlite3 and b/osinaweb/db.sqlite3 differ diff --git a/osinaweb/osinacore/__pycache__/consumers.cpython-310.pyc b/osinaweb/osinacore/__pycache__/consumers.cpython-310.pyc index 7f417cf3..bec9a3bb 100644 Binary files a/osinaweb/osinacore/__pycache__/consumers.cpython-310.pyc and b/osinaweb/osinacore/__pycache__/consumers.cpython-310.pyc differ diff --git a/osinaweb/osinacore/consumers.py b/osinaweb/osinacore/consumers.py index 0d9adbff..db305cbb 100644 --- a/osinaweb/osinacore/consumers.py +++ b/osinaweb/osinacore/consumers.py @@ -49,17 +49,24 @@ class OnlineUserConsumer(WebsocketConsumer): customer_connections = [] staff_connections = [] for connection in sorted_connections: - connection_data = { - 'user_id': connection.user.id, - 'username': connection.user.username, - 'last_seen': connection.last_seen.isoformat() if connection.last_seen else None - } if hasattr(connection.user, 'customerprofile'): + connection_data = { + 'first_name': connection.user.first_name, + 'last_name': connection.user.last_name, + 'last_seen': connection.user.customerprofile.get_last_seen, + 'online': connection.online + } customer_connections.append(connection_data) elif hasattr(connection.user, 'staffprofile'): + connection_data = { + 'first_name': connection.user.first_name, + 'last_name': connection.user.last_name, + 'last_seen': connection.user.staffprofile.get_last_seen, + 'image': connection.user.staffprofile.image.url, + 'online': connection.online + } staff_connections.append(connection_data) - print(staff_connections) event = { 'type': 'online_user_connection_handler', 'staff_connections': staff_connections, diff --git a/osinaweb/osinacore/templates/details_templates/partials/recently-online.html b/osinaweb/osinacore/templates/details_templates/partials/recently-online.html index 15be5791..b75d595f 100644 --- a/osinaweb/osinacore/templates/details_templates/partials/recently-online.html +++ b/osinaweb/osinacore/templates/details_templates/partials/recently-online.html @@ -19,17 +19,17 @@
{{staff_connection.user.first_name}} - {{staff_connection.user.last_name}}
+{{staff_connection.first_name}} + {{staff_connection.last_name}}
{% if staff_connection.online %}Online
{% else %} -{{staff_connection.user.staffprofile.get_last_seen}}
+{{staff_connection.last_seen}}
{% endif %}{{customer_connection.user.first_name|slice:":1"}}{{customer_connection.user.last_name|slice:":1"}} +
{{customer_connection.first_name|slice:":1"}}{{customer_connection.last_name|slice:":1"}}
{{customer_connection.user.first_name}} - {{customer_connection.user.last_name}}
+{{customer_connection.first_name}} + {{customer_connection.last_name}}
{% if customer_connection.online %}Online
{% else %} -{{customer_connection.user.customerprofile.get_last_seen}}
+{{customer_connection.last_seen}}
{% endif %}