Skip to content

Commit

Permalink
Resolve 'thread._local' object has no attribute 'host' ckan/ckan#3145
Browse files Browse the repository at this point in the history
  • Loading branch information
KrzysztofMadejski committed Mar 21, 2017
1 parent 3e4f446 commit 440def1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions ckanext/archiver/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
import datetime
import copy
import re
import routes
import time
import urlparse

from requests.packages import urllib3

Expand All @@ -34,6 +36,12 @@ def load_config(ckan_ini_filepath):
ckan.config.environment.load_environment(conf.global_conf,
conf.local_conf)

## 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
Expand Down

0 comments on commit 440def1

Please sign in to comment.