Skip to content

Commit

Permalink
[upload,api][xs]: remove use of ${filename} (see comments in file) an…
Browse files Browse the repository at this point in the history
…d fix up routing for api.
  • Loading branch information
rufuspollock committed Apr 29, 2011
1 parent 4a2ca5d commit 12f95da
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions ckanext/storage/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ class Storage(SingletonPlugin):
def after_map(self, route_map):
c = "ckanext.storage.controller:StorageAPIController"
route_map.connect('storage_api', "/api/storage", controller=c, action="index")
route_map.connect("/api/storage/metadata/{label}", controller=c, action="set_metadata",
route_map.connect("/api/storage/metadata/{label:.*}", controller=c, action="set_metadata",
conditions={"method": ["PUT", "POST"]})
route_map.connect("/api/storage/metadata/{label}", controller=c, action="get_metadata",
route_map.connect("/api/storage/metadata/{label:.*}", controller=c, action="get_metadata",
conditions={"method": ["GET"]})
route_map.connect('storage_api_auth_request',
"/api/storage/auth/request/{label:.*}",
Expand Down
6 changes: 5 additions & 1 deletion ckanext/storage/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,11 @@ def index(self):
h.flash_error('Not authorized to upload files.')
abort(401)

label = key_prefix + request.params.get('filepath', str(uuid.uuid4())) # + '/$filename'
label = key_prefix + request.params.get('filepath', str(uuid.uuid4()))
# would be nice to use filename of file
# problem is 'we' don't know this at this point and cannot add it to
# success_action_redirect and hence cannnot display to user afterwards
# + '/${filename}'
content_length_range = int(
config.get('ckanext.upload.max_content_length',
50000000))
Expand Down

0 comments on commit 12f95da

Please sign in to comment.