Commit 0deeafb9 authored by ale's avatar ale

decode json entries from redis

parent f38b8e51
......@@ -34,7 +34,9 @@ def get_virus_by_user():
virus_by_user = {}
rdb = get_redis_connection()
for obj in ai.LDAPObj(ai.config.base_uid).search('(&(objectClass=ftpAccount)(status=active))'):
virus_by_user[obj['ftpname']] = rdb.lrange('virus:%s' % obj['ftpname'], 0, -1)
entries = rdb.lrange('virus:%s' % obj['ftpname'], 0, -1)
if entries:
virus_by_user[obj['ftpname']] = [json.loads(x) for x in entries]
return virus_by_user
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment