1
Fork 0
mirror of https://github.com/pds-nest/nest.git synced 2024-11-25 14:34:19 +00:00

eliminato to_json dalla risposta get

This commit is contained in:
stefanogoldoni 2021-05-01 12:27:12 +02:00
parent 1b08a46ea6
commit f149fdc06c

View file

@ -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"):