Skip to content

Commit

Permalink
[#1200] fix more issues with pull request
Browse files Browse the repository at this point in the history
  • Loading branch information
kindly committed Oct 23, 2013
1 parent ad4e793 commit 9359e8d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion ckan/templates/package/resource_data.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<div class="alert alert-error">
<strong>{{ _('Upload error:') }}</strong> {{ status.error.message }}
</div>
{% elif status.task_info.error %}
{% elif status.task_info and status.task_info.error %}
{% set show_table = false %}
<div class="alert alert-error">
<strong>{{ _('Error:') }}</strong> {{ status.task_info.error }}
Expand Down
2 changes: 2 additions & 0 deletions ckanext/datapusher/logic/action.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,13 @@ def datapusher_status(context, data_dict):
job_id = value.get('job_id')
url = None
job_detail = None

if job_id:
url = urlparse.urljoin(datapusher_url, 'job' + '/' + job_id)
try:
r = requests.get(url, headers={'Content-Type': 'application/json',
'Authorization': job_key})
r.raise_for_status()
job_detail = r.json()
except (requests.exceptions.ConnectionError,
requests.exceptions.HTTPError), e:
Expand Down
12 changes: 5 additions & 7 deletions ckanext/datastore/logic/action.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,13 @@ def datastore_create(context, data_dict):

# create resource from file
if has_url:
try:
p.toolkit.get_action('datapusher_submit')(context, {
'resource_id': res['id'],
'set_url_type': True
})
except KeyError:
if not 'datapusher' in pylons.config.get('plugins'):
raise p.toolkit.ValidationError({'resource': [
'The datapusher has to be enabled.']})

p.toolkit.get_action('datapusher_submit')(context, {
'resource_id': res['id'],
'set_url_type': True
})
# since we'll overwrite the datastore resource anyway, we
# don't need to create it here
return
Expand Down

0 comments on commit 9359e8d

Please sign in to comment.