diff --git a/ckanext/harvest/logic/action/create.py b/ckanext/harvest/logic/action/create.py index aceff8e..0f2933a 100644 --- a/ckanext/harvest/logic/action/create.py +++ b/ckanext/harvest/logic/action/create.py @@ -8,7 +8,7 @@ from ckanext.harvest.logic import HarvestJobExists from ckanext.harvest.plugin import DATASET_TYPE_NAME from ckanext.harvest.model import (HarvestSource, HarvestJob) from ckanext.harvest.logic.dictization import harvest_job_dictize -from ckanext.harvest.logic.schema import harvest_source_db_to_form_schema +from ckanext.harvest.logic.schema import harvest_source_show_package_schema from ckanext.harvest.logic.action.get import harvest_source_list,harvest_job_list log = logging.getLogger(__name__) @@ -58,7 +58,7 @@ def harvest_source_create(context,data_dict): context['extras_as_string'] = True package_dict = logic.get_action('package_create')(context, data_dict) - context['schema'] = harvest_source_db_to_form_schema() + context['schema'] = harvest_source_show_package_schema() source = logic.get_action('package_show')(context, package_dict) return source diff --git a/ckanext/harvest/logic/action/update.py b/ckanext/harvest/logic/action/update.py index c304ca7..e273b62 100644 --- a/ckanext/harvest/logic/action/update.py +++ b/ckanext/harvest/logic/action/update.py @@ -20,8 +20,7 @@ from ckanext.harvest.queue import get_gather_publisher from ckanext.harvest.model import HarvestSource, HarvestJob, HarvestObject from ckanext.harvest.logic import HarvestJobExists -from ckanext.harvest.logic.schema import harvest_source_db_to_form_schema - +from ckanext.harvest.logic.schema import harvest_source_show_package_schema from ckanext.harvest.logic.action.get import harvest_source_show, harvest_job_list, _get_sources_for_user @@ -75,7 +74,7 @@ def harvest_source_update(context,data_dict): context['extras_as_string'] = True package_dict = logic.get_action('package_update')(context, data_dict) - context['schema'] = harvest_source_db_to_form_schema() + context['schema'] = harvest_source_show_package_schema() source = logic.get_action('package_show')(context, package_dict) return source diff --git a/ckanext/harvest/logic/schema.py b/ckanext/harvest/logic/schema.py index a837c11..7a0c9e2 100644 --- a/ckanext/harvest/logic/schema.py +++ b/ckanext/harvest/logic/schema.py @@ -56,6 +56,12 @@ def harvest_source_create_package_schema(): return schema +def harvest_source_update_package_schema(): + + schema = harvest_source_create_package_schema() + + return schema + def harvest_source_show_package_schema(): schema = harvest_source_schema() diff --git a/ckanext/harvest/plugin.py b/ckanext/harvest/plugin.py index d7d7b43..761a6cf 100644 --- a/ckanext/harvest/plugin.py +++ b/ckanext/harvest/plugin.py @@ -153,8 +153,10 @@ class Harvest(p.SingletonPlugin, DefaultDatasetForm): Returns the schema for mapping package data from a form to a format suitable for the database. ''' - return self.create_package_schema() + from ckanext.harvest.logic.schema import harvest_source_update_package_schema + schema = harvest_source_update_package_schema() + return schema def show_package_schema(self): '''