Skip to content

Commit

Permalink
[#716] Do not use provided schema on later package_show calls
Browse files Browse the repository at this point in the history
Make sure that if users provide a schema in the context, it is only used
for creating or updating the packages, but not on the package_show call
at the end of the functions.
  • Loading branch information
amercader committed Apr 9, 2013
1 parent 05bc0be commit 22c1845
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ckan/logic/action/create.py
Expand Up @@ -176,6 +176,9 @@ def package_create(context, data_dict):
context["id"] = pkg.id
log.debug('Created object %s' % str(pkg.name))

# Make sure that a user provided schema is not used on package_show
context.pop('schema', None)

return_id_only = context.get('return_id_only', False)

output = context['id'] if return_id_only \
Expand Down
3 changes: 3 additions & 0 deletions ckan/logic/action/update.py
Expand Up @@ -291,6 +291,9 @@ def package_update(context, data_dict):

return_id_only = context.get('return_id_only', False)

# Make sure that a user provided schema is not used on package_show
context.pop('schema', None)

# we could update the dataset so we should still be able to read it.
context['ignore_auth'] = True
output = data_dict['id'] if return_id_only \
Expand Down

0 comments on commit 22c1845

Please sign in to comment.