From f149fdc06c83290784a8c6bc457c33d35865f1b0 Mon Sep 17 00:00:00 2001 From: stefanogoldoni Date: Sat, 1 May 2021 12:27:12 +0200 Subject: [PATCH] eliminato to_json dalla risposta get --- code/backend/nest_backend/routes/users/user.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/backend/nest_backend/routes/users/user.py b/code/backend/nest_backend/routes/users/user.py index 755daa1..19e65d0 100644 --- a/code/backend/nest_backend/routes/users/user.py +++ b/code/backend/nest_backend/routes/users/user.py @@ -20,8 +20,8 @@ def page_user(email): return json_error("Thou art not authorized."), 403 target = find_user(email).to_json() if not target: - json_error("Could not locate the user."), 404 - return json_success(target.to_json()) + return json_error("Could not locate the user."), 404 + return json_success(target) elif request.method == "DELETE": if not user.isAdmin: return json_error("User is not admin."), 403 @@ -38,7 +38,7 @@ def page_user(email): return json_error("Thou art not authorized."), 403 target = find_user(email) if not target: - json_error("Could not locate the user."), 404 + return json_error("Could not locate the user."), 404 if request.json.get("username"): target.username = request.json.get("username") if request.json.get("password"):