From 41196ae4452aa57128fc1e71eed4a70b04e98c53 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Wed, 15 Jun 2022 13:39:06 +0200 Subject: [PATCH] add system uuid to snapshots list --- ereuse_devicehub/inventory/views.py | 6 ++++++ ereuse_devicehub/templates/inventory/snapshots_list.html | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/ereuse_devicehub/inventory/views.py b/ereuse_devicehub/inventory/views.py index b7a8298b..8c483268 100644 --- a/ereuse_devicehub/inventory/views.py +++ b/ereuse_devicehub/inventory/views.py @@ -594,12 +594,18 @@ class SnapshotListView(GenericMixin): ).order_by(SnapshotsLog.created.desc()) logs = {} for snap in snapshots_log: + try: + system_uuid = snap.snapshot.device.system_uuid or '' + except AttributeError: + system_uuid = '' + if snap.snapshot_uuid not in logs: logs[snap.snapshot_uuid] = { 'sid': snap.sid, 'snapshot_uuid': snap.snapshot_uuid, 'version': snap.version, 'device': snap.get_device(), + 'system_uuid': system_uuid, 'status': snap.get_status(), 'severity': snap.severity, 'created': snap.created, diff --git a/ereuse_devicehub/templates/inventory/snapshots_list.html b/ereuse_devicehub/templates/inventory/snapshots_list.html index 43253d1b..f8a34b23 100644 --- a/ereuse_devicehub/templates/inventory/snapshots_list.html +++ b/ereuse_devicehub/templates/inventory/snapshots_list.html @@ -29,6 +29,7 @@ Snapshot id Version DHID + System UUID Status Time @@ -60,6 +61,9 @@ {% endif %} + + {{ snap.system_uuid }} + {{ snap.status }}