From 871c5517f9d4532797979b55efe940e238bfab96 Mon Sep 17 00:00:00 2001 From: tobes Date: Tue, 2 Oct 2012 10:20:06 +0100 Subject: [PATCH] [#2939] Update the package owner when package updated to allow searches --- ckan/logic/action/create.py | 4 ++++ ckan/logic/action/update.py | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/ckan/logic/action/create.py b/ckan/logic/action/create.py index b320cd5e013..9028e2fc9d1 100644 --- a/ckan/logic/action/create.py +++ b/ckan/logic/action/create.py @@ -152,6 +152,10 @@ def package_create(context, data_dict): # Needed to let extensions know the package id model.Session.flush() + _get_action('package_owner_org_update')(context, + {'id': pkg.id, + 'organization_id': pkg.owner_org}) + for item in plugins.PluginImplementations(plugins.IPackageController): item.create(pkg) diff --git a/ckan/logic/action/update.py b/ckan/logic/action/update.py index a3d1d1db29a..b249b60ee31 100644 --- a/ckan/logic/action/update.py +++ b/ckan/logic/action/update.py @@ -269,6 +269,10 @@ def package_update(context, data_dict): pkg = model_save.package_dict_save(data, context) + _get_action('package_owner_org_update')(context, + {'id': pkg.id, + 'organization_id': pkg.owner_org}) + for item in plugins.PluginImplementations(plugins.IPackageController): item.edit(pkg) if not context.get('defer_commit'):