Skip to content

Commit

Permalink
[#2484] Pass brand new context to function creating default views
Browse files Browse the repository at this point in the history
  • Loading branch information
amercader committed Jun 26, 2015
1 parent dd5d6a4 commit 9183b98
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion ckan/logic/action/create.py
Expand Up @@ -213,7 +213,9 @@ def package_create(context, data_dict):
# Create default views for resources if necessary
if data.get('resources'):
logic.get_action('package_create_default_resource_views')(
context, {'package': data})
{'model': context['model'], 'user': context['user'],
'ignore_auth': True},
{'package': data})

if not context.get('defer_commit'):
model.repo.commit()
Expand Down
4 changes: 3 additions & 1 deletion ckan/logic/action/update.py
Expand Up @@ -366,7 +366,9 @@ def package_update(context, data_dict):
# Create default views for resources if necessary
if data.get('resources'):
logic.get_action('package_create_default_resource_views')(
context, {'package': data})
{'model': context['model'], 'user': context['user'],
'ignore_auth': True},
{'package': data})

if not context.get('defer_commit'):
model.repo.commit()
Expand Down

0 comments on commit 9183b98

Please sign in to comment.