diff options
author | zsloan | 2020-06-17 16:28:15 -0500 |
---|---|---|
committer | zsloan | 2020-06-17 16:28:15 -0500 |
commit | fcb3cb1105cf2a1d97c1a08fa636b118ed231ffa (patch) | |
tree | cab30579676503bef2596206684a66783bde6832 /wqflask/utility/redis_tools.py | |
parent | 15f5df7fe795a32e2d61dd11f825e53b1a1175ec (diff) | |
download | genenetwork2-fcb3cb1105cf2a1d97c1a08fa636b118ed231ffa.tar.gz |
A user's id is now set as a parameter if it doesn't already existauthentication_test
Diffstat (limited to 'wqflask/utility/redis_tools.py')
-rw-r--r-- | wqflask/utility/redis_tools.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/wqflask/utility/redis_tools.py b/wqflask/utility/redis_tools.py index c6d221ff..9d09a66b 100644 --- a/wqflask/utility/redis_tools.py +++ b/wqflask/utility/redis_tools.py @@ -30,6 +30,7 @@ def is_redis_available(): def get_user_id(column_name, column_value): user_list = Redis.hgetall("users") + key_list = [] for key in user_list: user_ob = json.loads(user_list[key]) if column_name in user_ob and user_ob[column_name] == column_value: @@ -62,6 +63,9 @@ def get_users_like_unique_column(column_name, column_value): if column_name != "user_id": for key in user_list: user_ob = json.loads(user_list[key]) + if "user_id" not in user_ob: + set_user_attribute(key, "user_id", key) + user_ob["user_id"] = key if column_name in user_ob: if column_value in user_ob[column_name]: matched_users.append(user_ob) |