aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2023-02-09 15:48:29 +0300
committerFrederick Muriuki Muriithi2023-02-09 15:48:29 +0300
commit739c9cca55d93b2cbf200e816daf0800aaa187c8 (patch)
tree13c381e2619cba41ba5c74f8c8426920aff932d4
parentbcc845d44bac5866f021320cf15f0d0b2ca341c0 (diff)
downloadgenenetwork2-739c9cca55d93b2cbf200e816daf0800aaa187c8.tar.gz
oauth2: fix variable name. Fetch join requests if there's no group.
-rw-r--r--wqflask/wqflask/oauth2/users.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/wqflask/wqflask/oauth2/users.py b/wqflask/wqflask/oauth2/users.py
index 94c3a4ce..28a495aa 100644
--- a/wqflask/wqflask/oauth2/users.py
+++ b/wqflask/wqflask/oauth2/users.py
@@ -24,13 +24,15 @@ def user_profile():
**kwargs)
def __roles_success__(roles):
+ if bool(usr_dets.get("group")):
+ return __render__(usr_dets, roles)
return oauth2_get("oauth2/user/group/join-request").either(
lambda err: __render__(
user_details, group_join_error=process_error(err)),
- lambda gjr: __render__(user_details, group_join_request=gjr))
+ lambda gjr: __render__(usr_dets, group_join_request=gjr))
return oauth2_get("oauth2/user/roles").either(
- lambda err: __render__(user_details, role_error=process_error(err)),
+ lambda err: __render__(usr_dets, role_error=process_error(err)),
__roles_success__)
@users.route("/request-add-to-group", methods=["POST"])