aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMilo Casagrande <milo.casagrande@linaro.org>2015-03-18 10:47:26 +0100
committerMilo Casagrande <milo.casagrande@linaro.org>2015-03-18 10:47:26 +0100
commite367f0ebd100c462e1eede2098e6b8903c7940b2 (patch)
treeddc32538d127ac28c7791bb639316271e95c383d
parent603cf399278c4bc305ce6a421ec3fc70d9cf6399 (diff)
Get rid of the double serializations.
* Now that Celery is using a custom json serializer that can handle dates and BSON objects, we do not need anymore the manual serialization and deserialization of the results coming from the bisect API.
-rw-r--r--app/utils/bisect/boot.py22
-rw-r--r--app/utils/bisect/defconfig.py22
2 files changed, 4 insertions, 40 deletions
diff --git a/app/utils/bisect/boot.py b/app/utils/bisect/boot.py
index aa5fb5b..3bdc66a 100644
--- a/app/utils/bisect/boot.py
+++ b/app/utils/bisect/boot.py
@@ -85,16 +85,7 @@ def execute_boot_bisection(doc_id, db_options, fields=None):
bcommon.save_bisect_doc(database, bisect_doc, doc_id)
bisect_doc = bcommon.update_doc_fields(bisect_doc, fields)
- result = [
- json.loads(
- json.dumps(
- bisect_doc,
- default=bson.json_util.default,
- ensure_ascii=False,
- separators=(",", ":")
- )
- )
- ]
+ result = [bisect_doc]
else:
code = 404
result = None
@@ -307,16 +298,7 @@ def execute_boot_bisection_compared_to(
bcommon.save_bisect_doc(database, bisect_doc, doc_id)
bisect_doc = bcommon.update_doc_fields(bisect_doc, fields)
- result = [
- json.loads(
- json.dumps(
- bisect_doc,
- default=bson.json_util.default,
- ensure_ascii=False,
- separators=(",", ":")
- )
- )
- ]
+ result = [bisect_doc]
else:
code = 404
result = None
diff --git a/app/utils/bisect/defconfig.py b/app/utils/bisect/defconfig.py
index 4707ffa..47c2257 100644
--- a/app/utils/bisect/defconfig.py
+++ b/app/utils/bisect/defconfig.py
@@ -189,16 +189,7 @@ def execute_defconfig_bisection(doc_id, db_options, fields=None):
bcommon.save_bisect_doc(database, bisect_doc, doc_id)
bisect_doc = bcommon.update_doc_fields(bisect_doc, fields)
- result = [
- json.loads(
- json.dumps(
- bisect_doc,
- default=bson.json_util.default,
- ensure_ascii=False,
- separators=(",", ":")
- )
- )
- ]
+ result = [bisect_doc]
else:
code = 404
result = None
@@ -320,16 +311,7 @@ def execute_defconfig_bisection_compared_to(
bcommon.save_bisect_doc(database, bisect_doc, doc_id)
bisect_doc = bcommon.update_doc_fields(bisect_doc, fields)
- result = [
- json.loads(
- json.dumps(
- bisect_doc,
- default=bson.json_util.default,
- ensure_ascii=False,
- separators=(",", ":")
- )
- )
- ]
+ result = [bisect_doc]
else:
code = 404
result = None