fix phid
This commit is contained in:
parent
60e783258e
commit
4d3ab6a70c
|
@ -475,6 +475,12 @@ class EraseBasic(JoinedWithOneDeviceMixin, ActionWithOneDevice):
|
|||
# todo will this url_for_resource work for other resources?
|
||||
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:
|
||||
return '{} on {}.'.format(self.severity, self.date_str)
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@
|
|||
</td>
|
||||
<td>
|
||||
<a href="{{ url_for('inventory.device_details', id=ac.device.parent.dhid) }}">
|
||||
{{ ac.device.parent.phid() }}
|
||||
{{ ac.get_phid() }}
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
|
|
Reference in New Issue