diff --git a/django_form_builder/dynamic_fields.py b/django_form_builder/dynamic_fields.py index f422299..0a08143 100644 --- a/django_form_builder/dynamic_fields.py +++ b/django_form_builder/dynamic_fields.py @@ -348,7 +348,7 @@ def __init__(self, *args, **data_kwargs): def raise_error(self, name, cleaned_data, **kwargs): if not cleaned_data: return [] # Only numbers (expressions like 16e50 aren't permitted) - if not re.match('^[0-9]+\.?[0-9]?$', str(cleaned_data)): + if not re.match('^[0-9]+(.([0-9]+))?$', str(cleaned_data)): return [_("Solo numeri ammessi"),] @@ -735,11 +735,11 @@ class CustomPasswordField(CharField, BaseCustomField): field_type = _("Password") widget = forms.PasswordInput PASSWORD_SEC_REGEX = getattr( - settings, + settings, 'PASSWORD_SEC_REGEX', "^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$%^&*-]).{8,}$" - ) - + ) + def raise_error(self, name, cleaned_data, **kwargs): if not re.match(self.PASSWORD_SEC_REGEX, cleaned_data): return ["Password is not secure enough, please add more entropy"] diff --git a/requirements-dev.txt b/requirements-dev.txt index 0ca3fa8..779cfc1 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,7 +6,7 @@ pytest-cov pylama codecov -sphinx>=2.0.0 +sphinx>=3.3.0 sphinx_rtd_theme sphinxcontrib-images @@ -17,3 +17,8 @@ black flake8 isort bandit +certifi>=2023.7.22 # not directly required, pinned by Snyk to avoid a vulnerability +jinja2>=3.1.3 # not directly required, pinned by Snyk to avoid a vulnerability +pygments>=2.15.0 # not directly required, pinned by Snyk to avoid a vulnerability +requests>=2.31.0 # not directly required, pinned by Snyk to avoid a vulnerability +setuptools>=65.5.1 # not directly required, pinned by Snyk to avoid a vulnerability diff --git a/setup.py b/setup.py index 9a7bf21..1b42dfb 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ setup( name='django-form-builder', - version='1.0.1', + version='1.1.0', packages=find_packages(), package_data={'': ['*.wav']}, data_files=[