From 4f28c2c5487ce2b8f00ba75e3cf322f33ff3f904 Mon Sep 17 00:00:00 2001 From: j Date: Sat, 5 Mar 2016 15:36:39 +0530 Subject: [PATCH] fix annotation import, values are decoded in d1.9 --- pandora/annotation/tasks.py | 5 ++--- pandora/archive/views.py | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/pandora/annotation/tasks.py b/pandora/annotation/tasks.py index 658fd4f05..38ad440cc 100644 --- a/pandora/annotation/tasks.py +++ b/pandora/annotation/tasks.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- # vi:si:et:sw=4:sts=4:ts=4 -import json import ox from django.conf import settings @@ -28,12 +27,12 @@ def update_matches(id, type): a_matches.add(Model.get_or_create(a.value)) for p in a_matches.all(): p.update_matches() - + if a.findvalue: names = {} for n in Model.objects.all().values('id', 'name', 'alternativeNames'): names[n['id']] = [ox.decode_html(x) - for x in [n['name']] + json.loads(n['alternativeNames'])] + for x in (n['name'],) + n['alternativeNames']] value = a.findvalue.lower() current = [p.id for p in a_matches.all()] diff --git a/pandora/archive/views.py b/pandora/archive/views.py index 1713b2294..7ba6927d7 100644 --- a/pandora/archive/views.py +++ b/pandora/archive/views.py @@ -368,7 +368,7 @@ def getTaskStatus(request, data): if status in default_backend.EXCEPTION_STATES: traceback = default_backend.get_traceback(task_id) response['data'].update({ - 'result': str(res.args[0]), + 'result': str(res), 'exc': get_full_cls_name(res.__class__), 'traceback': traceback })