From 74c8a48d6e79f4e2481c044595069d162a155175 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Fri, 2 Sep 2022 16:40:35 +0200 Subject: [PATCH] get erasure datas form abstract device and drop parent details --- ereuse_devicehub/resources/device/models.py | 6 +++++- ereuse_devicehub/templates/inventory/erasure.html | 12 ------------ 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/ereuse_devicehub/resources/device/models.py b/ereuse_devicehub/resources/device/models.py index bdf4a654..f37ef586 100644 --- a/ereuse_devicehub/resources/device/models.py +++ b/ereuse_devicehub/resources/device/models.py @@ -1049,10 +1049,14 @@ class Computer(Device): """Returns the privacy of all ``DataStorage`` components when it is not None. """ + components = self.components + if self.placeholder and self.placeholder.binding: + components = self.placeholder.binding.components + return set( privacy for privacy in ( - hdd.privacy for hdd in self.components if isinstance(hdd, DataStorage) + hdd.privacy for hdd in components if isinstance(hdd, DataStorage) ) if privacy ) diff --git a/ereuse_devicehub/templates/inventory/erasure.html b/ereuse_devicehub/templates/inventory/erasure.html index 5a16390c..57fa5139 100644 --- a/ereuse_devicehub/templates/inventory/erasure.html +++ b/ereuse_devicehub/templates/inventory/erasure.html @@ -40,18 +40,6 @@
Data storage:
{{ erasure.device.__format__('ts') }}
-
Computer where was erase:
-
Title: {{ erasure.parent.__format__('ts') }}
-
DevicehubID: {{ erasure.parent.devicehub_id }}
-
Hid: {{ erasure.parent.hid }}
-
Tags: {{ erasure.parent.tags }}
- -
Computer where it resides:
-
Title: {{ erasure.device.parent.__format__('ts') }}
-
DevicehubID: {{ erasure.device.parent.devicehub_id }}
-
Hid: {{ erasure.device.parent.hid }}
-
Tags: {{ erasure.device.parent.tags }}
-
Erasure:
{{ erasure.__format__('ts') }}
{% if erasure.steps %}