Commit 80b0a91f authored by Birin Sanchez's avatar Birin Sanchez

Restrict use of characters: \'" in password due to a Woo REST API

problem dealing with them.
Signed-off-by: Birin Sanchez's avatarBirin Sanchez <birin.sanchez@puri.sm>
parent d5cc7d18
Pipeline #9109 passed with stage
in 46 seconds
......@@ -5,6 +5,7 @@ from django import forms
from django.conf import settings
from django.contrib.auth import get_user_model
from django.contrib.auth import logout
from django.core.validators import RegexValidator
from django.http import HttpResponseRedirect
from django.urls import reverse
from django.utils import timezone
......@@ -41,6 +42,21 @@ class CartRegistrationForm(RegistrationForm):
required=False,
)
password1 = forms.CharField(
label=_("Passphrase"),
strip=False,
widget=forms.PasswordInput,
help_text=_('A good passphrase is made of at least three long words.'),
validators=[
RegexValidator(
regex=r'[\\\'\"]',
message=_('\\ \' and \" are not valid characters'),
code=None,
inverse_match=True,
flags=0),
],
)
class CartRegistrationFormWithCaptcha(CartRegistrationForm):
captcha = CaptchaField(
label=_('Please solve this sum'),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment