Browse Source

completed user doc

master
Julio Biason 11 years ago
parent
commit
94aa39ad3e
  1. 27
      luncho/blueprints/users.py

27
luncho/blueprints/users.py

@ -102,11 +102,14 @@ def update_user():
{ "status": "OK" } { "status": "OK" }
**Request not in JSON format (400)**: :py:class:`RequestMustBeJSONException` **Request not in JSON format (400)**:
:py:class:`RequestMustBeJSONException`
**User not found (via token) (404)**: :py:class:`UserNotFoundException` **User not found (via token) (404)**:
:py:class:`UserNotFoundException`
**Authorization required (412)**: :py:class:`AuthorizationRequiredException` **Authorization required (412)**:
:py:class:`AuthorizationRequiredException`
""" """
json = request.get_json(force=True) json = request.get_json(force=True)
user = request.user user = request.user
@ -126,7 +129,23 @@ def update_user():
@users.route('', methods=['DELETE']) @users.route('', methods=['DELETE'])
@auth @auth
def delete_user(): def delete_user():
"""Delete a user. No confirmation is send.""" """*Authenticated request* Delete a user.
**Success (200)**:
.. sourcecode:: http
HTTP/1.1 200 OK
Content-Type: text/json
{ "status": "OK" }
**User not found (via token) (404)**:
:py:class:`UserNotFoundException`
**Authorization required (412)**:
:py:class:`AuthorizationRequiredException`
"""
db.session.delete(request.user) db.session.delete(request.user)
db.session.commit() db.session.commit()
return jsonify(status='OK') return jsonify(status='OK')

Loading…
Cancel
Save