aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorneodarz <neodarz@neodarz.net>2019-07-08 16:58:14 +0200
committerneodarz <neodarz@neodarz.net>2019-07-08 16:58:14 +0200
commit8869dd6e2e016aafc090fef2bf3ea90b8a956ec8 (patch)
treea8b98b8f0e2e9df10978b6d9418ff3cc6b681258
parent97858b6edfaaee44077761663d2ade3b84e6d3d7 (diff)
downloadumosapi-8869dd6e2e016aafc090fef2bf3ea90b8a956ec8.tar.xz
umosapi-8869dd6e2e016aafc090fef2bf3ea90b8a956ec8.zip
Be more pythonic on returned message by flask
-rw-r--r--umosapi/api.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/umosapi/api.py b/umosapi/api.py
index ef83c18..72240f5 100644
--- a/umosapi/api.py
+++ b/umosapi/api.py
@@ -66,7 +66,7 @@ class Register(Resource):
args = request.get_json(force=True)
status = uobject.register(args.get('name'), args.get('datas'))
- return loads('{"msg": "'+status['msg']+'"}'), status['code']
+ return {"msg": status['msg']}, status['code']
@api.route('/objects/<name>')
@@ -76,4 +76,4 @@ class Remove(Resource):
""" Remove an uobject """
status = uobject.remove(name)
- return loads('{"msg": "'+status['msg']+'"}'), status['code']
+ return {"msg": status['msg']}, status['code']