From a1c8b564906fd9f80144ad432a44742770910d2f Mon Sep 17 00:00:00 2001 From: Benjamin Becker <benjamin.becker@dataport.de> Date: Wed, 15 Sep 2021 15:48:14 +0000 Subject: [PATCH] adds comment --- ckanext/odsh/plugin.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ckanext/odsh/plugin.py b/ckanext/odsh/plugin.py index bd7c1688..a2b0d4a5 100644 --- a/ckanext/odsh/plugin.py +++ b/ckanext/odsh/plugin.py @@ -220,9 +220,11 @@ class OdshPlugin(plugins.SingletonPlugin, DefaultTranslation, DefaultDatasetForm if resource.get('package_id'): tools.add_attributes_resources(context, resource) - def after_update(self, context, resource): - if resource.get('package_id'): - tools.add_attributes_resources(context, resource) + def after_update(self, context, resource_or_package): + if resource_or_package.get('package_id'): # this is a resource + tools.add_attributes_resources(context, resource_or_package) + else: # this is a package + pass @staticmethod def _update_is_new_in_pkg_dict(pkg_dict): -- GitLab