Skip to content

Commit

Permalink
[#2939] Update the package owner when package updated to allow searches
Browse files Browse the repository at this point in the history
  • Loading branch information
tobes committed Oct 2, 2012
1 parent 85a7d23 commit 871c551
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ckan/logic/action/create.py
Expand Up @@ -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)

Expand Down
4 changes: 4 additions & 0 deletions ckan/logic/action/update.py
Expand Up @@ -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'):
Expand Down

0 comments on commit 871c551

Please sign in to comment.