aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorneodarz <neodarz@neodarz.net>2019-07-08 17:02:12 +0200
committerneodarz <neodarz@neodarz.net>2019-07-08 17:02:12 +0200
commit6dffc5977642b8529e39348bcf5f78b33199f968 (patch)
tree617fe6147351a69e0e3efb1890e4a6673f826de2
parent8869dd6e2e016aafc090fef2bf3ea90b8a956ec8 (diff)
downloadumosapi-6dffc5977642b8529e39348bcf5f78b33199f968.tar.xz
umosapi-6dffc5977642b8529e39348bcf5f78b33199f968.zip
Fix some dict to respect JSON double quote
Diffstat (limited to '')
-rw-r--r--umosapi/app_db/uobject.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/umosapi/app_db/uobject.py b/umosapi/app_db/uobject.py
index 3d29bf6..0ba328c 100644
--- a/umosapi/app_db/uobject.py
+++ b/umosapi/app_db/uobject.py
@@ -18,7 +18,7 @@ class UObject(object):
error = {}
if not name:
- error = {'msg': 'Object name is required.', 'code': 400}
+ error = {"msg": "Object name is required.", "code": 400}
elif type(datas) != dict:
error = {
"msg": "Object datas type is not dict (JSON).",
@@ -26,12 +26,12 @@ class UObject(object):
}
elif len(list(mongo.db.objects.find({"name": name}))) > 0:
error = {
- 'msg': 'Object {} is already registered.'.format(name),
- 'code': 409
+ "msg": "Object {} is already registered.".format(name),
+ "code": 409
}
if not error:
mongo.db.objects.insert({"name": name, "datas": datas})
- return {'msg': 'Object {} added.'.format(name), 'code': 201}
+ return {"msg": "Object {} added.".format(name), "code": 201}
return error
def remove(self, name):
@@ -40,14 +40,14 @@ class UObject(object):
error = {}
if not name:
- error = {'msg': 'Object name is required', 'code': 400}
+ error = {"msg": "Object name is required", "code": 400}
elif len(list(mongo.db.objects.find({"name": name}))) == 0:
error = {
'msg': "User {} not exist. So it's good".format(name),
- 'code': 404
+ "code": 404
}
if not error:
- mongo.db.objects.remove({'name': name})
- return {'msg': 'Object {} deleted'.format(name), 'code': 200}
+ mongo.db.objects.remove({"name": name})
+ return {"msg": "Object {} deleted".format(name), "code": 200}
return error