From 8b8ff2d2c142d0177a21bbe1ff2f4923d34890b1 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Thu, 14 Jan 2021 18:18:59 +0100 Subject: [PATCH] refixed bug --- ereuse_devicehub/resources/action/models.py | 2 ++ ereuse_devicehub/resources/device/models.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ereuse_devicehub/resources/action/models.py b/ereuse_devicehub/resources/action/models.py index b04e62ac..2f7cde4b 100644 --- a/ereuse_devicehub/resources/action/models.py +++ b/ereuse_devicehub/resources/action/models.py @@ -558,6 +558,8 @@ class Snapshot(JoinedWithOneDeviceMixin, ActionWithOneDevice): if not act.type == "TestDataStorage": continue data['lifetime'] = act.lifetime + if not isinstance(act.lifetime, int): + data['lifetime'] = act.lifetime.total_seconds() break hdds.append(data) diff --git a/ereuse_devicehub/resources/device/models.py b/ereuse_devicehub/resources/device/models.py index 5d9346a3..7081ce49 100644 --- a/ereuse_devicehub/resources/device/models.py +++ b/ereuse_devicehub/resources/device/models.py @@ -346,7 +346,7 @@ class Device(Thing): if act.type == 'Live': allocate = copy.copy(allo) - lifetime = act.usage_time_hdd + lifetime = act.usage_time_hdd.total_seconds() allocate['type'] = 'Live' allocate['liveCreate'] = act.created for hd in lifestimes: