From 97b18154d197daf1264dba23276ea92bdaaf8e41 Mon Sep 17 00:00:00 2001 From: "me@jeffersonbledsoe.com" Date: Wed, 20 Dec 2023 18:00:37 +0000 Subject: [PATCH] Fix serializer deleting the actual validation object's settings --- .../volto/formsupport/restapi/deserializer/__init__.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/collective/volto/formsupport/restapi/deserializer/__init__.py b/src/collective/volto/formsupport/restapi/deserializer/__init__.py index 77b34d96..c9697de3 100644 --- a/src/collective/volto/formsupport/restapi/deserializer/__init__.py +++ b/src/collective/volto/formsupport/restapi/deserializer/__init__.py @@ -57,9 +57,12 @@ def _expand_validation_field(self, field): for validation_id, validation in matched_validation_definitions: settings = vars(validation)["_settings"] - for ignored_setting in IGNORED_VALIDATION_DEFINITION_ARGUMENTS: - if ignored_setting in settings: - del settings[ignored_setting] + settings = { + k: v + for k, v in settings.items() + for ignored_setting in IGNORED_VALIDATION_DEFINITION_ARGUMENTS + if ignored_setting not in settings + } field[validation_id] = settings # if api.user.has_permission("Modify portal content", obj=self.context):