From 61b020aeed87293e0436050408a9f12ff12d5b92 Mon Sep 17 00:00:00 2001 From: "me@jeffersonbledsoe.com" Date: Wed, 17 Jan 2024 23:41:20 +0000 Subject: [PATCH] Fix bad settings appearing in UI --- .../volto/formsupport/validation/__init__.py | 18 ------------------ .../custom_validators/CharactersValidator.py | 9 +-------- 2 files changed, 1 insertion(+), 26 deletions(-) diff --git a/src/collective/volto/formsupport/validation/__init__.py b/src/collective/volto/formsupport/validation/__init__.py index d37d1060..0f3140bb 100644 --- a/src/collective/volto/formsupport/validation/__init__.py +++ b/src/collective/volto/formsupport/validation/__init__.py @@ -19,24 +19,6 @@ class IFieldValidator(Interface): """Base marker for collective.volto.formsupport field validators.""" -def inMaxCharacters(value, **kwargs): - breakpoint() - - -def _clean_validation_settings(settings): - def delete_setting(setting): - if hasattr(settings, setting): - del settings[setting] - - delete_setting("name") - delete_setting("title") - delete_setting("description") - delete_setting("regex_strings") - delete_setting("regex") - delete_setting("errmsg") - return settings - - def _update_validators(): """ Add Products.validation validators to the available list of validators diff --git a/src/collective/volto/formsupport/validation/custom_validators/CharactersValidator.py b/src/collective/volto/formsupport/validation/custom_validators/CharactersValidator.py index e42a9dca..8f8886b1 100644 --- a/src/collective/volto/formsupport/validation/custom_validators/CharactersValidator.py +++ b/src/collective/volto/formsupport/validation/custom_validators/CharactersValidator.py @@ -1,12 +1,10 @@ from Products.validation.interfaces.IValidator import IValidator from zope.interface import implementer -from collective.volto.formsupport.validation.definition import ValidationDefinition - # TODO: Tidy up code structure so we don't need to be a definition @implementer(IValidator) -class CharactersValidator(): +class CharactersValidator: def __init__(self, name, title="", description="", characters=0, _internal_type=""): self.name = name self.title = title or name @@ -14,11 +12,6 @@ def __init__(self, name, title="", description="", characters=0, _internal_type= self.characters = characters self._internal_type = _internal_type - # From super class. Hacky implementation having this here for now - self._name = name - # self._name = name - # self.settings = vars(self) - @property def settings(self): return vars(self)