mirror of
https://github.com/jazzband/django-defender.git
synced 2026-03-16 22:10:32 +00:00
Make key_list read from redis Python 3 compatible
Converts from bytes to string using .decode('utf-8')
This commit is contained in:
parent
b21b53577f
commit
67ebb8edff
1 changed files with 2 additions and 2 deletions
|
|
@ -88,14 +88,14 @@ def strip_keys(key_list):
|
|||
def get_blocked_ips():
|
||||
""" get a list of blocked ips from redis """
|
||||
key = get_ip_blocked_cache_key("*")
|
||||
key_list = REDIS_SERVER.keys(key)
|
||||
key_list = [redis_key.decode('utf-8') for redis_key in REDIS_SERVER.keys(key)]
|
||||
return strip_keys(key_list)
|
||||
|
||||
|
||||
def get_blocked_usernames():
|
||||
""" get a list of blocked usernames from redis """
|
||||
key = get_username_blocked_cache_key("*")
|
||||
key_list = REDIS_SERVER.keys(key)
|
||||
key_list = [redis_key.decode('utf-8') for redis_key in REDIS_SERVER.keys(key)]
|
||||
return strip_keys(key_list)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue