Skip to content

Commit

Permalink
Fix bad settings appearing in UI
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffersonBledsoe committed Jan 17, 2024
1 parent bec2107 commit 61b020a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 26 deletions.
18 changes: 0 additions & 18 deletions src/collective/volto/formsupport/validation/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,17 @@
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
self.description = description
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)
Expand Down

0 comments on commit 61b020a

Please sign in to comment.