diff --git a/ereuse_devicehub/resources/device/models.py b/ereuse_devicehub/resources/device/models.py index 1e3d4b12..3bb98ffb 100644 --- a/ereuse_devicehub/resources/device/models.py +++ b/ereuse_devicehub/resources/device/models.py @@ -1022,16 +1022,17 @@ class Device(Thing): return def get_set_lots(self): - if self.lots: + if hasattr(self, "orphan") and self.orphan: + if self.binding: + return set(self.binding.device.lots) return set(self.lots) - if hasattr(self, "parent") and self.parent and self.parent.lots: + if hasattr(self, "parent") and self.parent: + if self.parent.binding: + return set(self.parent.binding.device.lots) return set(self.parent.lots) - if self.binding: - return self.binding.device.get_set_lots() - - return set() + return set(self.lots) def __lt__(self, other): return self.id < other.id diff --git a/ereuse_devicehub/templates/inventory/erasure.html b/ereuse_devicehub/templates/inventory/erasure.html index 7b8ae650..a5eb0039 100644 --- a/ereuse_devicehub/templates/inventory/erasure.html +++ b/ereuse_devicehub/templates/inventory/erasure.html @@ -161,7 +161,7 @@ {% if erasure_hosts %} - N° of sanitization server {{ erasure_hosts|length }}: + SNs; of sanitization server {{ erasure_hosts|length }}: {% for e in erasure_hosts %} @@ -267,14 +267,9 @@ {% if erasures %} - {% if erasure_hosts %} - {% for server in erasure_hosts %}
-

Server Summary

-
-
-

SN Server {{ server.serial_number and server.serial_number.upper() }}

+

Summary

@@ -283,6 +278,7 @@ SN Storage + SN Host Method Result Date @@ -290,51 +286,12 @@ {% for erasure in erasures %} - {% if erasure.parent == server %} {{ erasure.device.serial_number.upper() }} - {{ erasure.get_public_name() }} - - - {{ erasure.severity.get_public_name() }} - - - {{ erasure.date_str }} - - - {% endif %} - {% endfor %} - - -
- - {% endfor %} - {% endif %} - {% if erasures_normal %} -
-
-

Devices Summary

-
-
-
-
- - - - - - - - - - - {% for erasure in erasures_normal %} - -
SN StorageMethodResultDate
- {{ erasure.device.serial_number.upper() }} + {{ erasure.parent.serial_number.upper() }} {{ erasure.get_public_name() }} @@ -351,7 +308,6 @@
- {% endif %} {% for erasure in erasures %}