Handle when user has never logged into the system.

This commit is contained in:
Santiago Lamora 2020-03-12 07:45:11 +01:00
parent 4b5c62a7c6
commit cb418475cf
2 changed files with 4 additions and 3 deletions

View file

@ -2,7 +2,7 @@
Package metadata definition.
"""
VERSION = (0, 2, 0, 'alpha', 0)
VERSION = (0, 2, 0, 'alpha', 1)
def get_version():

View file

@ -120,8 +120,9 @@ class UserAccount(OrchestraModel):
if 'language' in data:
language = data['language'].lower()
if 'last_login' in data:
last_login = parse_datetime(data['last_login'])
last_login = data.get('last_login')
if last_login is not None:
last_login = parse_datetime(last_login)
return super().new_from_json(data=data, billing=billing, language=language, last_login=last_login)