From 3bfd962149d1f797eb414094c4da6955fdccbfdd Mon Sep 17 00:00:00 2001 From: David Glick Date: Thu, 5 Dec 2024 10:46:28 -0800 Subject: [PATCH] don't return attachments in the response after posting --- .../volto/formsupport/restapi/services/submit_form/post.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/src/collective/volto/formsupport/restapi/services/submit_form/post.py b/backend/src/collective/volto/formsupport/restapi/services/submit_form/post.py index 247efee..c942f67 100644 --- a/backend/src/collective/volto/formsupport/restapi/services/submit_form/post.py +++ b/backend/src/collective/volto/formsupport/restapi/services/submit_form/post.py @@ -75,7 +75,10 @@ def reply(self): self.request.response.setStatus(500) return {"type": "InternalServerError", "message": message} - return {"data": self.form_data} + data_without_attachments = { + k: v for k, v in self.form_data.items() if type(v) is not dict + } + return {"data": data_without_attachments} def cleanup_data(self): """Ignore fields not defined in form schema"""