Skip to content

Commit

Permalink
Merge pull request #4721 from hardingalexh/refetch-package-after-reso…
Browse files Browse the repository at this point in the history
…urce-delete

Retrieving the package after plugins run
  • Loading branch information
smotornyuk committed Apr 15, 2019
2 parents 330d747 + 5df3164 commit 4ffbd46
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ckan/logic/action/delete.py
Expand Up @@ -182,6 +182,8 @@ def resource_delete(context, data_dict):
plugin.before_delete(context, data_dict,
pkg_dict.get('resources', []))

pkg_dict = _get_action('package_show')(context, {'id': package_id})

if pkg_dict.get('resources'):
pkg_dict['resources'] = [r for r in pkg_dict['resources'] if not
r['id'] == id]
Expand All @@ -193,7 +195,7 @@ def resource_delete(context, data_dict):

for plugin in plugins.PluginImplementations(plugins.IResourceController):
plugin.after_delete(context, pkg_dict.get('resources', []))

model.repo.commit()


Expand Down

0 comments on commit 4ffbd46

Please sign in to comment.