diff --git a/api/account/account_api/endpoints/device.py b/api/account/account_api/endpoints/device.py index ca9f51b7..d2382343 100644 --- a/api/account/account_api/endpoints/device.py +++ b/api/account/account_api/endpoints/device.py @@ -119,6 +119,11 @@ class DeviceEndpoint(SeleneEndpoint): else: last_contact_age = datetime.utcnow() - device.last_contact_ts else: + last_contact_ts = last_contact_ts.decode() + last_contact_ts = datetime.strptime( + last_contact_ts, + '%Y-%m-%d %H:%M:%S.%f' + ) last_contact_age = datetime.utcnow() - last_contact_ts return last_contact_age