[LoginToken] verify if login token exists before checking its validity
This commit is contained in:
parent
18c0428e05
commit
9283b5a319
|
@ -55,8 +55,8 @@ class LoginToken(StorableObject):
|
|||
has_good_authentication = classmethod(has_good_authentication)
|
||||
|
||||
def get(cls, id, ignore_errors=False, ignore_migration=False):
|
||||
o = StorableObject.get(id, ignore_errors, ignore_migration)
|
||||
if not o.valid():
|
||||
o = super(LoginToken, cls).get(id, ignore_errors, ignore_migration)
|
||||
if o and not o.valid():
|
||||
o.remove_self()
|
||||
if ignore_errors:
|
||||
return None
|
||||
|
|
Reference in New Issue