aboutsummaryrefslogtreecommitdiff
path: root/src/lb_app/api.py
diff options
context:
space:
mode:
authorneodarz <neodarz@neodarz.net>2018-08-18 21:49:20 +0200
committerneodarz <neodarz@neodarz.net>2018-08-18 21:49:20 +0200
commit7867863b6cd21a87b97df7cabd6871f6a5204602 (patch)
tree95ca60c5a7a064b2d916120a9c220d0383eb4a07 /src/lb_app/api.py
parente9ad5e5069f65aa25cecf4cef136a3ab728fda59 (diff)
downloadliberationCenter-7867863b6cd21a87b97df7cabd6871f6a5204602.tar.xz
liberationCenter-7867863b6cd21a87b97df7cabd6871f6a5204602.zip
Add ability to remove a user
Diffstat (limited to '')
-rw-r--r--src/lb_app/api.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/lb_app/api.py b/src/lb_app/api.py
index 6dfe2e8..9827828 100644
--- a/src/lb_app/api.py
+++ b/src/lb_app/api.py
@@ -41,3 +41,14 @@ class Register(Resource):
if status is None:
return loads('{"msg": "done"}'), 201
return loads('{"msg": "'+status+'"}'), 200
+
+@api.route('/users/<username>')
+@api.doc(params={'username': 'Jean'})
+class Remove(Resource):
+ def delete(self, username):
+ """ Remove a user """
+ status = user.remove(username)
+
+ if status is None:
+ return loads('{"msg": "done"}'), 201
+ return loads('{"msg": "'+status+'"}'), 200