Commit 70b1d0c9 authored by Marko Kuder's avatar Marko Kuder

fixed unicode errors and "thread._local' object has no attribute 'host'"

parent 5618245a
......@@ -7,6 +7,8 @@ import datetime
import json
import os
import traceback
import urlparse
import routes
import ckan.lib.celery_app as celery_app
from ckan.plugins import toolkit
......@@ -55,6 +57,12 @@ def load_config(ckan_ini_filepath):
except StatementError, e:
log.error('Statement error in load_config even after dropping Session and retrying: '+str(e))
raise StatementError("Statement error even after dropping Session and retrying: "+str(e))
## give routes enough information to run url_for
parsed = urlparse.urlparse(conf.get('ckan.site_url', 'http://0.0.0.0'))
request_config = routes.request_config()
request_config.host = parsed.netloc + parsed.path
request_config.protocol = parsed.scheme
def register_translator():
# Register a translator in this thread so that
......@@ -453,7 +461,7 @@ def save_qa_result(resource, qa_result, log):
qa = QA.create(resource.id)
model.Session.add(qa)
else:
log.info(u'QA from before: %r', unicode(qa, errors='ignore'))
log.info(u'QA from before: %s', unicode(qa))
for key in ('openness_score', 'openness_score_reason', 'format'):
setattr(qa, key, qa_result[key])
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment