diff options
author | Milo Casagrande <milo.casagrande@linaro.org> | 2014-11-14 10:33:56 +0100 |
---|---|---|
committer | Milo Casagrande <milo.casagrande@linaro.org> | 2014-11-14 10:33:56 +0100 |
commit | 98becd655a434e68fe58cbdc5ded9b6636213c39 (patch) | |
tree | 8776fa62c86c9b108d524fe0cf5400bcc33d13e6 /app/utils/bisect | |
parent | c7e19ef695509dd7a80202bc665a886df54ab014 (diff) |
Update json library, fix models.
Change-Id: I4f673d40870a0f2db260acca24adde8886c3f072
Diffstat (limited to 'app/utils/bisect')
-rw-r--r-- | app/utils/bisect/__init__.py | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/app/utils/bisect/__init__.py b/app/utils/bisect/__init__.py index 29e52dc..22dc972 100644 --- a/app/utils/bisect/__init__.py +++ b/app/utils/bisect/__init__.py @@ -13,13 +13,14 @@ """All the bisect operations that the app can perform.""" +try: + import simplejson as json +except ImportError: + import json + from bson import tz_util from bson.json_util import default from datetime import datetime -from json import ( - dumps as j_dump, - loads as j_load, -) from pymongo import DESCENDING from types import DictionaryType @@ -236,7 +237,11 @@ def execute_boot_bisection(doc_id, db_options, fields=None): LOG.error("Error savind bisect data %s", doc_id) bisect_doc = _update_doc_fields(bisect_doc, fields) - result = [j_load(j_dump(bisect_doc, default=default))] + result = [ + json.loads( + json.dumps(bisect_doc, default=default, ensure_ascii=False) + ) + ] else: code = 404 result = None |