fixed bug with formatting of last contact ts from redis

pull/192/head^2
Chris Veilleux 2019-09-12 14:58:34 -05:00
parent 4b1ec6eb9d
commit ed76bf6c48
1 changed files with 5 additions and 0 deletions

View File

@ -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