Merge pull request #351 from eReuse/bugfix/2656-certificates

fix phid
This commit is contained in:
cayop 2022-09-20 13:33:13 +02:00 committed by GitHub
commit d245ca21a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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>