From 60a5c718441eaaf5696716231de476ff8ec79bb1 Mon Sep 17 00:00:00 2001 From: mutantsan Date: Wed, 24 Apr 2024 14:18:15 +0300 Subject: [PATCH] update: use config_schema signal --- README.md | 4 ++-- ckanext/drupal_api/plugin.py | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 47fe41c..bea014f 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ you need to set a smaller value. ## Requirements -* CKAN>=2.9 +* CKAN>=2.10 * python>=3.7 ## Installation @@ -31,7 +31,7 @@ To install ckanext-drupal-api: pip install -e . pip install -r requirements.txt -3. Add `drupal-api` to the `ckan.plugins` setting in your CKAN +3. Add `drupal_api` to the `ckan.plugins` setting in your CKAN config file (by default the config file is located at `/etc/ckan/default/ckan.ini`). diff --git a/ckanext/drupal_api/plugin.py b/ckanext/drupal_api/plugin.py index 39e10e4..6c0c169 100644 --- a/ckanext/drupal_api/plugin.py +++ b/ckanext/drupal_api/plugin.py @@ -36,6 +36,9 @@ def get_signal_subscriptions(self) -> types.SignalMapping: tk.signals.ckanext.signal("ap_main:collect_config_sections"): [ self.collect_config_sections_subs ], + tk.signals.ckanext.signal("ap_main:collect_config_schemas"): [ + self.collect_config_schemas_subs + ], } @staticmethod @@ -51,6 +54,10 @@ def collect_config_sections_subs(sender: None): ], } + @staticmethod + def collect_config_schemas_subs(sender: None): + return ["ckanext.drupal_api:config_schema.yaml"] + if tk.check_ckan_version("2.10"): tk.blanket.config_declarations(DrupalApiPlugin)