aboutsummaryrefslogtreecommitdiff
path: root/gn2/wqflask
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2024-06-17 11:07:33 -0500
committerAlexander_Kabui2024-08-28 15:02:45 +0300
commitd0ca2b1e0eccc05d70f2b83f061a36cebec98e4a (patch)
tree63467a16ec032da2da013e48f6a6c520cae2d80c /gn2/wqflask
parentc3b20093ea8bca6f02547c9c926d7b52163aee24 (diff)
downloadgenenetwork2-d0ca2b1e0eccc05d70f2b83f061a36cebec98e4a.tar.gz
Use json for communication with gn-auth
Diffstat (limited to 'gn2/wqflask')
-rw-r--r--gn2/wqflask/oauth2/resources.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/gn2/wqflask/oauth2/resources.py b/gn2/wqflask/oauth2/resources.py
index 58e02368..32d89b14 100644
--- a/gn2/wqflask/oauth2/resources.py
+++ b/gn2/wqflask/oauth2/resources.py
@@ -58,7 +58,7 @@ def create_resource():
flash("Resource created successfully", "alert-success")
return redirect(url_for("oauth2.resource.user_resources"))
return oauth2_post(
- "auth/resource/create", data=request.form).either(
+ "auth/resource/create", json=dict(request.form)).either(
__perr__, __psuc__)
def __compute_page__(submit, current_page):
@@ -231,7 +231,7 @@ def assign_role(resource_id: UUID) -> Response:
return oauth2_post(
f"auth/resource/{resource_id}/user/assign",
- data={
+ json={
"group_role_id": group_role_id,
"user_email": user_email
}).either(__assign_error__, __assign_success__)
@@ -262,7 +262,7 @@ def unassign_role(resource_id: UUID) -> Response:
return oauth2_post(
f"auth/resource/{resource_id}/user/unassign",
- data={
+ json={
"group_role_id": group_role_id,
"user_id": user_id
}).either(__unassign_error__, __unassign_success__)
@@ -285,7 +285,7 @@ def toggle_public(resource_id: UUID):
"oauth2.resource.view_resource", resource_id=resource_id))
return oauth2_post(
- f"auth/resource/{resource_id}/toggle-public", data={}).either(
+ f"auth/resource/{resource_id}/toggle-public").either(
lambda err: __handle_error__(err),
lambda suc: __handle_success__(suc))