update dependencies

This commit is contained in:
Henning Jacobs
2022-05-20 11:17:25 +02:00
parent cb44d184a7
commit 1d09479a6a
5 changed files with 830 additions and 913 deletions

View File

@@ -16,7 +16,7 @@ def expo(n: int, base=2, factor=1, max_value=None):
of max_value will forever after be yielded.
"""
a = factor * base ** n
a = factor * base**n
if max_value is None or a < max_value:
return a
else:

View File

@@ -168,9 +168,9 @@ class RedisStore(AbstractStore):
def redeem_screen_token(self, token: str, remote_addr: str):
"""Validate the given token and bind it to the IP."""
redis_key = "screen-tokens:{}".format(token)
data = self._redis.get(redis_key)
if not data:
data_binary = self._redis.get(redis_key)
if not data_binary:
raise ValueError("Invalid token")
data = json.loads(data.decode("utf-8"))
data = json.loads(data_binary.decode("utf-8"))
data = check_token(token, remote_addr, data)
self._redis.set(redis_key, json.dumps(data))