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 %}
SN Storage | -Method | -Result | -Date | -
---|---|---|---|
- {{ erasure.device.serial_number.upper() }} + {{ erasure.parent.serial_number.upper() }} | {{ erasure.get_public_name() }} @@ -351,7 +308,6 @@ |