From 8955cd77739b54c4bfdecad8d587fbc073db706c Mon Sep 17 00:00:00 2001 From: Thorge Petersen <petersen@rz.uni-kiel.de> Date: Mon, 13 Feb 2023 09:27:14 +0100 Subject: [PATCH] Testing harvest route interception --- ckanext/odsh/plugin.py | 6 +++++- ckanext/odsh/views/harvest.py | 13 +++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 ckanext/odsh/views/harvest.py diff --git a/ckanext/odsh/plugin.py b/ckanext/odsh/plugin.py index 4ce7a2a4..f7c323f4 100644 --- a/ckanext/odsh/plugin.py +++ b/ckanext/odsh/plugin.py @@ -31,6 +31,7 @@ from ckanext.odsh.views import default from ckanext.odsh.views import package from ckanext.odsh.views import user from ckanext.odsh.views import dashboard +from ckanext.odsh.views import harvest from ckanext.dcat import blueprints as dcat_view log = logging.getLogger(__name__) @@ -95,7 +96,10 @@ class OdshPlugin(plugins.SingletonPlugin, DefaultTranslation, DefaultDatasetForm bp_dashboard.add_url_rule( u'/dashboard/datasets', view_func=dashboard.dashboard_datasets) - return [bp_default, bp_package, bp_user, bp_dashboard] + # + bp_harvest = harvest.blueprint + bp_harvest.add_url_rule(u'/harvest/new', view_func=dashboard.new) + return [bp_default, bp_package, bp_user, bp_dashboard, bp_harvest] # IActions diff --git a/ckanext/odsh/views/harvest.py b/ckanext/odsh/views/harvest.py new file mode 100644 index 00000000..832f4eab --- /dev/null +++ b/ckanext/odsh/views/harvest.py @@ -0,0 +1,13 @@ +import ckan.plugins.toolkit as toolkit +from flask import Blueprint +from ckan.views.dataset import CreateView +import logging + +log = logging.getLogger(__name__) + +blueprint = Blueprint('odsh_default', __name__) + +def new(): + log.info("views.harvest::new") + return CreateView.as_view(str(u'new')) + #toolkit.abort(404) \ No newline at end of file -- GitLab