From 739c9cca55d93b2cbf200e816daf0800aaa187c8 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Thu, 9 Feb 2023 15:48:29 +0300 Subject: oauth2: fix variable name. Fetch join requests if there's no group. --- wqflask/wqflask/oauth2/users.py | 6 ++++-- 1 file 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"]) -- cgit v1.2.3