From 617db41d3c1be5cc43da1ab78c0458f812a03bc0 Mon Sep 17 00:00:00 2001 From: mjanez <96422458+mjanez@users.noreply.github.com> Date: Wed, 23 Oct 2024 22:28:34 +0200 Subject: [PATCH] Refactor get_actions methods to simplify return statements and remove commented-out code --- ckanext/schemingdcat/plugin.py | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/ckanext/schemingdcat/plugin.py b/ckanext/schemingdcat/plugin.py index 8d8b0045..2ebeca31 100644 --- a/ckanext/schemingdcat/plugin.py +++ b/ckanext/schemingdcat/plugin.py @@ -93,9 +93,7 @@ def get_signal_subscriptions(self): #IActions def get_actions(self): - action_functions = _get_logic_functions('ckanext.schemingdcat.logic.action') - - return action_functions + return _get_logic_functions('ckanext.schemingdcat.logic.action') class SchemingDCATDatasetsPlugin(SchemingDatasetsPlugin): p.implements(p.IConfigurer) @@ -236,24 +234,9 @@ def about_template(self): class SchemingDCATOpenDataStatisticsPlugin(p.SingletonPlugin): - #p.implements(p.IConfigurer) p.implements(p.IActions) p.implements(p.IConfigurable) - # # IConfigurer - # def update_config(self, config_): - # sdct_config.schemingdcat_open_data_statistics_themes = p.toolkit.asbool( - # config_.get( - # "ckanext.schemingdcat.open_data_statistics_themes", sdct_config.schemingdcat_open_data_statistics_themes - # ) - # ) - - # sdct_config.schemingdcat_open_data_statistics = p.toolkit.asbool( - # config_.get( - # "ckanext.schemingdcat.open_data_statistics", sdct_config.schemingdcat_open_data_statistics - # ) - # ) - #IConfigurable def configure(self, config): args = sys.argv @@ -266,9 +249,7 @@ def configure(self, config): #IActions def get_actions(self): - action_functions = _get_logic_functions('ckanext.schemingdcat.statistics.logic.action') - - return action_functions + return _get_logic_functions('ckanext.schemingdcat.statistics.logic.action') def _get_logic_functions(module_root, logic_functions=None, decorator=None): """