diff --git a/ckanext/validation/commands.py b/ckanext/validation/commands.py index 4cb1ba69..9fa9e677 100644 --- a/ckanext/validation/commands.py +++ b/ckanext/validation/commands.py @@ -193,7 +193,7 @@ def _run_validation_on_resource(self, resource_id, dataset_id): msg.format(resource_id, dataset_id)) def _process_row(self, dataset, resource, writer): - resource_url = '{}/dataset/{}/resource/{}'.format( + resource_url = 'localhost:5000/{}/dataset/{}/resource/{}'.format( config['ckan.site_url'], dataset['name'], resource['id']) @@ -217,7 +217,7 @@ def _process_row_full(self, dataset, resource, writer): error_counts = {} - resource_url = '{}/dataset/{}/resource/{}'.format( + resource_url = 'localhost:5000/{}/dataset/{}/resource/{}'.format( config['ckan.site_url'], dataset['name'], resource['id']) diff --git a/ckanext/validation/jobs.py b/ckanext/validation/jobs.py index 23999b4c..1d733dd2 100644 --- a/ckanext/validation/jobs.py +++ b/ckanext/validation/jobs.py @@ -8,6 +8,7 @@ import requests from sqlalchemy.orm.exc import NoResultFound from frictionless import validate, system, Report, Schema, Dialect, Check +from ckan.common import config from ckan.model import Session import ckan.lib.uploader as uploader @@ -76,6 +77,7 @@ def run_validation_job(resource): if not source: source = resource['url'] + source = source.replace(config.get('ckan.site_url'), "http://localhost:5000") schema = resource.get('schema') if schema: