Skip to content

Commit

Permalink
need package dict to call uploader correctly (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
duttonw authored Jul 21, 2020
1 parent 3711388 commit 0325b1a
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion ckan/logic/action/get.py
Original file line number Diff line number Diff line change
Expand Up @@ -1174,8 +1174,19 @@ def resource_file_metadata_show(context, data_dict):

_check_access('resource_file_metadata_show', resource_context, data_dict)

pkg_dict = logic.get_action('package_show')(
dict(context),
{'id': resource.package.id,
'include_tracking': asbool(data_dict.get('include_tracking', False))})

for resource_dict in pkg_dict['resources']:
if resource_dict['id'] == id:
break
else:
log.error('Could not find resource %s after all', id)
raise NotFound(_('Resource was not found.'))

upload = uploader.get_resource_uploader(resource)
upload = uploader.get_resource_uploader(resource_dict)
try:
return upload.metadata(id)
except IOError:
Expand Down

0 comments on commit 0325b1a

Please sign in to comment.