Skip to content

Commit

Permalink
Fix serializer deleting the actual validation object's settings
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffersonBledsoe committed Dec 20, 2023
1 parent 94cd023 commit 97b1815
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 97b1815

Please sign in to comment.