[#29] Fix some imports on actions and plugin
This commit is contained in:
parent
c754479014
commit
fbc8ecde97
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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):
|
||||
'''
|
||||
|
|
Loading…
Reference in New Issue