commit
d245ca21a6
|
@ -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)
|
||||||
|
|
||||||
|
|
|
@ -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>
|
||||||
|
|
Reference in New Issue