From 6d8365564e439736a6f0eb4545b96e328c604ca9 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Tue, 20 Sep 2022 16:02:25 +0200 Subject: [PATCH] fix exports certificate for placeholders --- ereuse_devicehub/inventory/views.py | 2 ++ ereuse_devicehub/templates/inventory/erasure_list.html | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ereuse_devicehub/inventory/views.py b/ereuse_devicehub/inventory/views.py index 73e3badc..d0532c16 100644 --- a/ereuse_devicehub/inventory/views.py +++ b/ereuse_devicehub/inventory/views.py @@ -901,6 +901,8 @@ class ExportsView(View): def build_erasure_certificate(self): erasures = [] for device in self.find_devices(): + if device.placeholder and device.placeholder.binding: + device = device.placeholder.binding if isinstance(device, Computer): for privacy in device.privacy: erasures.append(privacy) diff --git a/ereuse_devicehub/templates/inventory/erasure_list.html b/ereuse_devicehub/templates/inventory/erasure_list.html index 6495d2d6..f9627966 100644 --- a/ereuse_devicehub/templates/inventory/erasure_list.html +++ b/ereuse_devicehub/templates/inventory/erasure_list.html @@ -63,7 +63,7 @@