Skip to content

Commit

Permalink
Merge branch '1451-use-site-url-for-datastore-callback'
Browse files Browse the repository at this point in the history
  • Loading branch information
amercader committed Jan 27, 2014
2 parents 6254fe5 + e7cae2c commit bb70fc5
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions ckanext/datapusher/logic/action.py
Expand Up @@ -45,9 +45,12 @@ def datapusher_submit(context, data_dict):

datapusher_url = pylons.config.get('ckan.datapusher.url')

callback_url = p.toolkit.url_for(
controller='api', action='action', logic_function='datapusher_hook',
ver=3, qualified=True)
site_url = pylons.config['ckan.site_url']

callback_url = site_url.rstrip('/') + p.toolkit.url_for(
controller='api', action='action',
logic_function='datapusher_hook', ver=3
)

user = p.toolkit.get_action('user_show')(context, {'id': context['user']})

Expand Down Expand Up @@ -86,7 +89,7 @@ def datapusher_submit(context, data_dict):
'job_type': 'push_to_datastore',
'result_url': callback_url,
'metadata': {
'ckan_url': pylons.config['ckan.site_url'],
'ckan_url': site_url,
'resource_id': res_id,
'set_url_type': data_dict.get('set_url_type', False)
}
Expand Down

0 comments on commit bb70fc5

Please sign in to comment.