Skip to content

Commit

Permalink
fix txinfo
Browse files Browse the repository at this point in the history
  • Loading branch information
cayop committed Feb 10, 2024
1 parent a7543d9 commit 0622a4f
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions ereuse_devicehub/resources/documents/device_row.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,9 +297,9 @@ def __init__(self, device: d.Device, document_ids: dict) -> None: # noqa: C901
self['Device Serial Number'] = none2str(device.serial_number)
self['Device Model'] = none2str(device.model)
self['Device Manufacturer'] = none2str(device.manufacturer)
self['Registered in'] = format(device.created, '%c')
self['Registered in'] = format(device.created.replace(tzinfo=None), '%c')
self['Registered (process)'] = software
self['Updated in (software)'] = device.updated
self['Updated in (software)'] = device.updated.replace(tzinfo=None)

if device.physical_status():
self['Physical state'] = device.physical_status().type
Expand Down Expand Up @@ -451,7 +451,9 @@ def get_erasure_datawipe_mobile(self, device):
self['Erasure DataStorage 1 Result'] = get_result(erasure)
self['Erasure DataStorage 1 Type'] = erasure.type
self['Erasure DataStorage 1 Software'] = erasure.document.software
self['Erasure DataStorage 1 Date'] = format(erasure.document.date or '')
self['Erasure DataStorage 1 Date'] = format(
erasure.document.date and erasure.document.date.replace(tzinfo=None) or ''
)
self['Erasure DataStorage 1 Certificate URL'] = (
erasure.document.url and erasure.document.url.to_text() or ''
)
Expand Down Expand Up @@ -496,7 +498,7 @@ def get_datastorage(self, ctype, i, component):
self['Erasure {} {} Result'.format(ctype, i)] = get_result(erasure)
self['Erasure {} {} Type'.format(ctype, i)] = erasure.type
self['Erasure {} {} Date'.format(ctype, i)] = format(
erasure.document.date or ''
erasure.document.date and erasure.document.date.replace(tzinfo=None) or ''
)
self['Erasure {} {} Certificate URL'.format(ctype, i)] = (
erasure.document.url and erasure.document.url.to_text() or ''
Expand Down Expand Up @@ -589,7 +591,7 @@ def __init__(self, device: d.Device) -> None:
self['Serial Number'] = none2str(device.serial_number)
self['Model'] = none2str(device.model)
self['Manufacturer'] = none2str(device.manufacturer)
self['Registered in'] = format(device.created, '%c')
self['Registered in'] = format(device.created.replace(tzinfo=None), '%c')
self['Physical state'] = ''
if device.physical_status():
self['Physical state'] = device.physical_status().type
Expand Down Expand Up @@ -664,11 +666,11 @@ def __init__(self, allocate):
self['Status Supplier – Created Date'] = allocate['status_supplier_created']
self['Status Receiver – Created Date'] = allocate['status_receiver_created']
self['Trade-Weight'] = allocate['trade_weight']
self['Action-Create'] = allocate['created']
self['Action-Create'] = allocate['created'] and allocate['created'].replace(tzinfo=None) or ''
self['Allocate-Start'] = allocate['start']
self['Allocate-User-Code'] = allocate['finalUserCode']
self['Allocate-NumUsers'] = allocate['numEndUsers']
self['UsageTimeAllocate'] = allocate['usageTimeAllocate']
self['Type'] = allocate['type']
self['LiveCreate'] = allocate['liveCreate']
self['LiveCreate'] = allocate['liveCreate'] and allocate['liveCreate'].replace(tzinfo=None) or ''
self['UsageTimeHdd'] = allocate['usageTimeHdd']

0 comments on commit 0622a4f

Please sign in to comment.