From 8869dd6e2e016aafc090fef2bf3ea90b8a956ec8 Mon Sep 17 00:00:00 2001 From: neodarz Date: Mon, 8 Jul 2019 16:58:14 +0200 Subject: Be more pythonic on returned message by flask --- umosapi/api.py | 4 ++-- 1 file 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/') @@ -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'] -- cgit v1.2.1