[LoginToken] verify if login token exists before checking its validity

This commit is contained in:
Benjamin Dauvergne 2010-07-19 08:29:03 +00:00
parent 18c0428e05
commit 9283b5a319
1 changed files with 2 additions and 2 deletions

View File

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