From d0ca2b1e0eccc05d70f2b83f061a36cebec98e4a Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Mon, 17 Jun 2024 11:07:33 -0500 Subject: Use json for communication with gn-auth --- gn2/wqflask/oauth2/resources.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'gn2/wqflask') 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)) -- cgit v1.2.3