Skip to content

Commit

Permalink
Fix volto.formsupport path to not alter returned data on POST.
Browse files Browse the repository at this point in the history
  • Loading branch information
cekk committed Dec 10, 2024
1 parent f068b1b commit 4da7fa0
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/design/plone/policy/patches/collective_volto_formsupport.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,24 +149,25 @@ def reply(self):
self.request.response.setStatus(500)
return dict(type="InternalServerError", message=message)

return {"data": data}
res = {"data": data}
waiting_list = (
self.submit_limit is not None and -1 < self.submit_limit < self.count_data()
)
if waiting_list:
res["waiting_list"] = waiting_list
# end patch
return res


def store_data(self):
store = getMultiAdapter((self.context, self.request), IFormDataStore)
# start patch
data = {"form_data": self.filter_parameters()}
data = self.filter_parameters()

res = store.add(data=data)
if not res:
raise BadRequest("Unable to store data")

waiting_list = (
self.submit_limit is not None and -1 < self.submit_limit < self.count_data()
)
data.update({"waiting_list": waiting_list})

return data


Expand Down Expand Up @@ -205,7 +206,7 @@ def add(self, data):
fields_labels = {}
fields_order = []
# start patch
for field_data in data["form_data"]:
for field_data in data:
# end patch
field_id = field_data.get("field_id", "")
value = field_data.get("value", "")
Expand Down

0 comments on commit 4da7fa0

Please sign in to comment.