Skip to content

Commit

Permalink
[#1273] fix typos and minor issues from pull request
Browse files Browse the repository at this point in the history
  • Loading branch information
kindly committed Dec 2, 2013
1 parent 89583c8 commit 042c161
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 9 deletions.
1 change: 0 additions & 1 deletion ckan/controllers/package.py
Expand Up @@ -1234,7 +1234,6 @@ def resource_download(self, id, resource_id, filename=None):
status, headers, app_iter = request.call_application(fileapp)
except OSError:
abort(404, _('Resource data not found'))
status, headers, app_iter = request.call_application(fileapp)
response.headers.update(dict(headers))
content_type, content_enc = mimetypes.guess_type(rsc.get('url',''))
response.headers['Content-Type'] = content_type
Expand Down
2 changes: 2 additions & 0 deletions ckan/lib/dictization/model_dictize.py
Expand Up @@ -148,6 +148,8 @@ def resource_dictize(res, context):
resource['format'] = _unified_resource_format(res.format)
# some urls do not have the protocol this adds http:// to these
url = resource['url']
## for_edit is only called at the times when the dataset is to be edited
## without for_edit the whole qualified resource is returned.
if resource.get('url_type') == 'upload' and not context.get('for_edit'):
resource_group = model.Session.query(
model.ResourceGroup).get(resource_group_id)
Expand Down
2 changes: 0 additions & 2 deletions ckan/logic/action/create.py
Expand Up @@ -241,8 +241,6 @@ def resource_create(context, data_dict):
:type webstore_last_updated: iso date string
:param upload: (optional)
:type upload: FieldStorage (optional) needs multipart/form-data
:param clear_upload: (optional)
:type clear_upload: boolean (optional) set to true to remove uplaoded file
:returns: the newly created resource
:rtype: dictionary
Expand Down
2 changes: 1 addition & 1 deletion ckan/templates/macros/form.html
Expand Up @@ -419,7 +419,7 @@

{% if is_upload_enabled %}
{{ input(field_upload, label=upload_label, id='field-image-upload', type='file', placeholder='', value='', error='', classes=['control-full']) }}
{% if is_uploadu%}
{% if is_upload %}
{{ checkbox(field_clear, label=_('Clear Upload'), id='field-clear-upload', value='true', error='', classes=['control-full']) }}
{% endif %}
{% endif %}
Expand Down
5 changes: 3 additions & 2 deletions doc/configuration.rst
Expand Up @@ -1020,7 +1020,7 @@ Default value: ``None``

Defines the storage backend used by CKAN: ``pairtree`` for local storage, ``s3`` for Amazon S3 Cloud Storage or ``google`` for Google Cloud Storage. Note that each of these must be accompanied by the relevant settings for each backend described below.

Depricated, only aviliable option is now pairtree.
Deprecated, only available option is now pairtree. This must be used nonetheless if upgrading for CKAN 2.1 in order to keep access to your old pairtree files.


.. _ofs.storage_dir:
Expand All @@ -1036,7 +1036,8 @@ Default value: ``None``

Only used with the local storage backend. Use this to specify where uploaded files should be stored, and also to turn on the handling of file storage. The folder should exist, and will automatically be turned into a valid pairtree repository if it is not already.

Depricated, please use ckan.storage_path.
Deprecated, please use ckan.storage_path. This must be used nonetheless if upgrading for CKAN 2.1 in order to keep access to your old pairtree files.




Expand Down
7 changes: 4 additions & 3 deletions doc/filestore.rst
Expand Up @@ -9,8 +9,9 @@ displayed against groups and organizations.
Previous versions of CKAN used to allow uploads to remote cloud hosting but
we have simplified this to only alow local file uploads. This is to give
CKAN more control over the files and make access control possible. If you
are already using pairtree local file storage then you should keep your
current settings, without change.
are already using pairtree local file storage then you must keep your
current settings, otherwise users will not be also able to download the old
uploaded files.

-------------------------------------------
Setup File Uploads
Expand Down Expand Up @@ -60,7 +61,7 @@ FileStore API

.. versionchanged:: 2.2
The previous API has been depricated although should still work if you where
using loca file storage.
using local file storage.

The api is part of the resource_create and resource_update action api
functions. You can post mutipart/form-data to the api and the key, value
Expand Down

0 comments on commit 042c161

Please sign in to comment.