This commit is contained in:
Cayo Puigdefabregas 2022-09-20 13:31:21 +02:00
parent 60e783258e
commit 4d3ab6a70c
2 changed files with 7 additions and 1 deletions

View File

@ -475,6 +475,12 @@ class EraseBasic(JoinedWithOneDeviceMixin, ActionWithOneDevice):
# todo will this url_for_resource work for other resources? # todo will this url_for_resource work for other resources?
return urlutils.URL(url_for_resource('Document', item_id=self.id)) return urlutils.URL(url_for_resource('Document', item_id=self.id))
def get_phid(self):
if self.device and self.device.parent:
if hasattr(self.device.parent, 'phid'):
return self.device.parent.phid()
return ''
def __str__(self) -> str: def __str__(self) -> str:
return '{} on {}.'.format(self.severity, self.date_str) return '{} on {}.'.format(self.severity, self.date_str)

View File

@ -84,7 +84,7 @@
</td> </td>
<td> <td>
<a href="{{ url_for('inventory.device_details', id=ac.device.parent.dhid) }}"> <a href="{{ url_for('inventory.device_details', id=ac.device.parent.dhid) }}">
{{ ac.device.parent.phid() }} {{ ac.get_phid() }}
</a> </a>
</td> </td>
<td> <td>