diff options
author | Arun Isaac | 2021-11-10 15:56:59 +0530 |
---|---|---|
committer | BonfaceKilz | 2021-11-13 08:00:40 +0300 |
commit | f566d9eb1d4e12d7e7a6ef319c39760f5726578e (patch) | |
tree | ea3c8ab1b79e80511a251c0a94069aeacb6486be /gn3/authentication.py | |
parent | 83f0e5c2955595de195a6de4a9aa7feeb94df9bb (diff) | |
download | genenetwork3-f566d9eb1d4e12d7e7a6ef319c39760f5726578e.tar.gz |
Do not shadow global symbol uuid.
* gn3/authentication.py (get_groups_by_user_uid): Rename local symbol uuid to
group_uuid.
(get_user_info_by_key): Rename local symbol uuid to user_uuid.
Diffstat (limited to 'gn3/authentication.py')
-rw-r--r-- | gn3/authentication.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gn3/authentication.py b/gn3/authentication.py index 7384df0..a6372c1 100644 --- a/gn3/authentication.py +++ b/gn3/authentication.py @@ -113,9 +113,9 @@ def get_groups_by_user_uid(user_uid: str, conn: Redis) -> Dict: """ admin = [] member = [] - for uuid, group_info in conn.hgetall("groups").items(): + for group_uuid, group_info in conn.hgetall("groups").items(): group_info = json.loads(group_info) - group_info["uuid"] = uuid + group_info["uuid"] = group_uuid if user_uid in group_info.get('admins'): admin.append(group_info) if user_uid in group_info.get('members'): @@ -130,10 +130,10 @@ def get_user_info_by_key(key: str, value: str, conn: Redis) -> Optional[Dict]: """Given a key, get a user's information if value is matched""" if key != "user_id": - for uuid, user_info in conn.hgetall("users").items(): + for user_uuid, user_info in conn.hgetall("users").items(): user_info = json.loads(user_info) if (key in user_info and user_info.get(key) == value): - user_info["user_id"] = uuid + user_info["user_id"] = user_uuid return user_info elif key == "user_id": if user_info := conn.hget("users", value): |