fix exports certificate for placeholders

This commit is contained in:
Cayo Puigdefabregas 2022-09-20 16:02:25 +02:00
parent 4d3ab6a70c
commit 6d8365564e
2 changed files with 3 additions and 1 deletions

View File

@ -901,6 +901,8 @@ class ExportsView(View):
def build_erasure_certificate(self): def build_erasure_certificate(self):
erasures = [] erasures = []
for device in self.find_devices(): for device in self.find_devices():
if device.placeholder and device.placeholder.binding:
device = device.placeholder.binding
if isinstance(device, Computer): if isinstance(device, Computer):
for privacy in device.privacy: for privacy in device.privacy:
erasures.append(privacy) erasures.append(privacy)

View File

@ -63,7 +63,7 @@
<td> <td>
<input type="checkbox" class="deviceSelect" data="{{ ac.device.id }}" <input type="checkbox" class="deviceSelect" data="{{ ac.device.id }}"
data-device-type="{{ ac.device.type }}" data-device-manufacturer="{{ ac.device.manufacturer }}" data-device-type="{{ ac.device.type }}" data-device-manufacturer="{{ ac.device.manufacturer }}"
data-device-dhid="{{ ac.device.devicehub_id }}" data-device-vname="{{ ac.device.verbose_name }}" data-device-dhid="{{ ac.device.dhid }}" data-device-vname="{{ ac.device.verbose_name }}"
{% if form_new_allocate.type.data and ac.device.id in list_devices %} {% if form_new_allocate.type.data and ac.device.id in list_devices %}
checked="checked" checked="checked"
{% endif %} {% endif %}