fix: return "message" instead of "error" so it is handled better at the client.

This commit is contained in:
fiatjaf
2020-11-10 22:59:50 -03:00
parent eaec3480e6
commit d4e30356c7
3 changed files with 15 additions and 7 deletions
+1 -1
View File
@@ -69,7 +69,7 @@ async def api_usermanager_users_delete(user_id):
async def api_usermanager_activate_extension():
user = get_user(g.data["userid"])
if not user:
return jsonify({"error": "no such user"}), HTTPStatus.NO_CONTENT
return jsonify({"message": "no such user"}), HTTPStatus.NOT_FOUND
update_user_extension(user_id=g.data["userid"], extension=g.data["extension"], active=g.data["active"])
return jsonify({"extension": "updated"}), HTTPStatus.CREATED