Skip to content

Commit

Permalink
Merge branch 'master' into snyk-fix-28758a95d47c1b384fadd6a769161056
Browse files Browse the repository at this point in the history
  • Loading branch information
francesco-filicetti authored Mar 13, 2024
2 parents c29e815 + eadec8d commit 452182b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
8 changes: 4 additions & 4 deletions django_form_builder/dynamic_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"),]


Expand Down Expand Up @@ -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"]
7 changes: 6 additions & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ pytest-cov
pylama
codecov

sphinx>=2.0.0
sphinx>=3.3.0
sphinx_rtd_theme
sphinxcontrib-images

Expand All @@ -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
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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=[
Expand Down

0 comments on commit 452182b

Please sign in to comment.