aboutsummaryrefslogtreecommitdiff
path: root/scripts/authentication/group.py
diff options
context:
space:
mode:
authorBonfaceKilz2021-10-04 13:45:59 +0300
committerBonfaceKilz2021-10-04 13:46:25 +0300
commit8fae92c83d49042da68638319385df02061df44b (patch)
tree346b34e7910bbb0408ce86b626aa66e6b235c60e /scripts/authentication/group.py
parentc5215d1ed224480a274476933beded9d2ba7f7dc (diff)
downloadgenenetwork2-8fae92c83d49042da68638319385df02061df44b.tar.gz
scripts: group.py: Remove "glom" dependency
Diffstat (limited to 'scripts/authentication/group.py')
-rw-r--r--scripts/authentication/group.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/scripts/authentication/group.py b/scripts/authentication/group.py
index 265e8664..02f782b3 100644
--- a/scripts/authentication/group.py
+++ b/scripts/authentication/group.py
@@ -30,7 +30,6 @@ import redis
import json
from typing import Dict, List, Optional, Set
-from glom import glom # type: ignore
def create_group_data(users: Dict, target_group: str,
@@ -74,10 +73,12 @@ def create_group_data(users: Dict, target_group: str,
"""
_members = "".join(members.split()).split(",") if members else []
_admins: List = "".join(admins.split()).split(",") if admins else []
-
- user_emails: Set = {glom(json.loads(user_details), "email_address")
- for _, user_details in users.items()}
-
+ user_emails: Set = set()
+ for _, user_details in users.items():
+ _details = json.loads(user_details)
+ if _details.get("email_address"):
+ user_emails.add(_details.get("email_address"))
+ print(user_emails)
return {"key": "groups",
"field": target_group,
"value": json.dumps({