From 7ef2a68d393391a299398b9c344ff46202698610 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Fri, 12 Feb 2021 20:06:20 +0100 Subject: [PATCH] fixed --- ereuse_devicehub/resources/device/models.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ereuse_devicehub/resources/device/models.py b/ereuse_devicehub/resources/device/models.py index cd2a7dd0..74d7ce97 100644 --- a/ereuse_devicehub/resources/device/models.py +++ b/ereuse_devicehub/resources/device/models.py @@ -376,7 +376,9 @@ class Device(Thing): allocate = copy.copy(allo) allocate['type'] = 'Live' allocate['liveCreate'] = act.created - allocate['usageTimeHdd'] = act.usage_time_hdd.total_seconds()/3600 + allocate['usageTimeHdd'] = 0 + if act.usage_time_hdd: + allocate['usageTimeHdd'] = act.usage_time_hdd.total_seconds()/3600 allocates.append(allocate) if act.type == 'Deallocate':