fix disks without placeholder

This commit is contained in:
Cayo Puigdefabregas 2022-10-25 11:10:39 +02:00
parent 95ac4e794b
commit 9d7869929c
2 changed files with 9 additions and 1 deletions

View File

@ -166,10 +166,14 @@ class DeviceDetailView(GenericMixin):
)
form_tags = TagDeviceForm(dhid=id)
placeholder = device.binding or device.placeholder
if not placeholder:
return NotFound()
self.context.update(
{
'device': device,
'placeholder': device.binding or device.placeholder,
'placeholder': placeholder,
'page_title': 'Device {}'.format(device.devicehub_id),
'form_tag_device': form_tags,
}

View File

@ -71,9 +71,13 @@
/>
</td>
<td>
{% if ac.device.phid() %}
<a href="{{ url_for('inventory.device_details', id=ac.device.dhid)}}">
{{ ac.device.serial_number.upper() }}
</a>
{% else %}
{{ ac.device.serial_number.upper() }}
{% endif %}
</td>
<td>
<a href="{{ url_for('inventory.export', export_id='snapshot') }}?id={{ ac.snapshot.uuid }}">