Skip to content

Commit

Permalink
Remove validations and settings if the field type doesn't allow for v…
Browse files Browse the repository at this point in the history
…alidations
  • Loading branch information
JeffersonBledsoe committed Jan 26, 2024
1 parent 0251d4b commit 41a7cda
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,15 @@ def _process_data(
self,
data,
):
self._update_validations(data)
return data

def _update_validations(self, data):
for field in data.get("subblocks"):
if field.get("field_type") not in ["text", "textarea", "from"]:
field["validations"] = []
field["validationSettings"] = {}


@implementer(IBlockFieldDeserializationTransformer)
@adapter(IBlocks, IBrowserRequest)
Expand Down

0 comments on commit 41a7cda

Please sign in to comment.