From 1466cbc4f48ca575d5a69c5cc348a3cd789dbc1e Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Tue, 21 Sep 2021 12:44:07 +0200 Subject: [PATCH] fixing bug of csv --- ereuse_devicehub/resources/documents/device_row.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ereuse_devicehub/resources/documents/device_row.py b/ereuse_devicehub/resources/documents/device_row.py index ea518a88..7379404d 100644 --- a/ereuse_devicehub/resources/documents/device_row.py +++ b/ereuse_devicehub/resources/documents/device_row.py @@ -245,7 +245,8 @@ class DeviceRow(OrderedDict): self['{} {} Size (MB)'.format(ctype, i)] = none2str(component.size) - erasures = [a for a in component.actions if a.type in [ + component_actions = sorted(component.actions, key=lambda x: x.created) + erasures = [a for a in component_actions if a.type in [ 'EraseBasic', 'EraseSectors', 'DataWipe']] erasure = erasures[-1] if erasures else None if not erasure: