diff --git a/api/handlers/listhandler.py b/api/handlers/listhandler.py index 29fbe119603ec17afa4b12db67a907cd05c15375..1201afd0d9696e885f37d91d533e8aa8c5ba5ca6 100644 --- a/api/handlers/listhandler.py +++ b/api/handlers/listhandler.py @@ -539,6 +539,7 @@ class FileListHandler(ListHandler): return upload.process_upload(self.request, upload.Strategy.targeted, container_type=cont_name, id_=_id, origin=self.origin) + @validators.verify_payload_exists def put(self, cont_name, list_name, **kwargs): _id = kwargs.pop('cid') permchecker, storage, _, _, _ = self._initialize_request(cont_name, list_name, _id, query_params=kwargs) diff --git a/test/integration_tests/python/test_containers.py b/test/integration_tests/python/test_containers.py index f57942d1f38c4375a31acf8edbd4cea9882e3e33..9dae19c97e3268c439736fac9ef667a461e12318 100644 --- a/test/integration_tests/python/test_containers.py +++ b/test/integration_tests/python/test_containers.py @@ -564,6 +564,11 @@ def test_edit_file_attributes(data_builder, as_admin, file_form): r = as_admin.put('/projects/' + project + '/files/' + file_name, json=payload) assert r.status_code == 400 + # Attempt to update with empty payload + payload = {} + r =as_admin.put('/projects/' + project + '/files/' + file_name, json=payload) + assert r.status_code == 400 + payload = { 'info': {} }