fix(tokens-repo): raise token not found when deleting nonexistent token
even if device name existspull/26/head
parent
95e200bfc5
commit
bf6c230ae0
|
@ -39,6 +39,8 @@ class RedisTokensRepository(AbstractTokensRepository):
|
||||||
"""Delete the token"""
|
"""Delete the token"""
|
||||||
r = self.connection
|
r = self.connection
|
||||||
key = RedisTokensRepository._token_redis_key(input_token)
|
key = RedisTokensRepository._token_redis_key(input_token)
|
||||||
|
if input_token not in self.get_tokens():
|
||||||
|
raise TokenNotFound
|
||||||
r.delete(key)
|
r.delete(key)
|
||||||
|
|
||||||
def reset(self):
|
def reset(self):
|
||||||
|
|
Loading…
Reference in New Issue