Skip to content
Snippets Groups Projects
Commit 1786a571 authored by Nathaniel Kofalt's avatar Nathaniel Kofalt
Browse files

Resolve singular/plural with ugly hack

parent 4402735d
No related branches found
No related tags found
No related merge requests found
......@@ -357,8 +357,15 @@ class FileListHandler(ListHandler):
def post(self, cont_name, list_name, **kwargs):
_id = kwargs.pop('cid')
# Ugly hack: ensure cont_name is singular. Pass singular or plural to code that expects it.
if cont_name.endswith('s'):
cont_name_plural = cont_name
cont_name = cont_name[:-1]
else:
cont_name_plural = cont_name + 's'
# Authorize
container, permchecker, storage, mongo_validator, payload_validator, keycheck = self._initialize_request(cont_name + 's', list_name, _id)
container, permchecker, storage, mongo_validator, payload_validator, keycheck = self._initialize_request(cont_name_plural, list_name, _id)
permchecker(noop)('POST', _id=_id)
return upload.process_upload(self.request, upload.Strategy.targeted, cont_name, _id)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment