Skip to content

Commit

Permalink
[#1078] move before_view plugin from dictize to action, feels more co…
Browse files Browse the repository at this point in the history
…nsistent
  • Loading branch information
wardi committed Jul 15, 2013
1 parent e5ea3cf commit fa2bb0b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
4 changes: 0 additions & 4 deletions ckan/lib/dictization/model_dictize.py
Expand Up @@ -300,10 +300,6 @@ def package_dictize(pkg, context):
result_dict['metadata_created'] = pkg.metadata_created.isoformat() \
if pkg.metadata_created else None

if context.get('for_view'):
for item in plugins.PluginImplementations( plugins.IPackageController):
result_dict = item.before_view(result_dict)

return result_dict

def _get_members(context, group, member_type):
Expand Down
3 changes: 2 additions & 1 deletion ckan/logic/action/get.py
Expand Up @@ -731,7 +731,8 @@ def package_show(context, data_dict):

if not package_dict:
package_dict = model_dictize.package_dictize(pkg, context)
elif context.get('for_view'):

if context.get('for_view'):
for item in plugins.PluginImplementations(plugins.IPackageController):
package_dict = item.before_view(package_dict)

Expand Down

0 comments on commit fa2bb0b

Please sign in to comment.