Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
CKAN 2.8 migrated api to flask and file handling was changed ckan/ckan#3884. This PR ports the change to cloudstorage.
Without it the upload would error with the following log:
Traceback (most recent call last): File "/usr/lib/ckan/default/src/ckan/ckan/views/api.py", line 288, in action result = function(context, request_data) File "/usr/lib/ckan/default/src/ckan/ckan/logic/__init__.py", line 464, in wrapped result = _action(context, data_dict, **kw) File "/vagrant/modules/ckanext-cloudstorage/ckanext/cloudstorage/logic/action/multipart.py", line 160, in upload_multipart data=bytearray(part_content.file.read()) File "/usr/lib/ckan/default/lib/python2.7/site-packages/werkzeug/datastructures.py", line 2745, in __getattr__ return getattr(self.stream, name) AttributeError: SpooledTemporaryFile instance has no attribute 'file'