expand regexp
This commit is contained in:
parent
f6b27d94ba
commit
5d0880bf4b
|
@ -15,7 +15,7 @@ class ProfileForm(forms.ModelForm):
|
||||||
|
|
||||||
def clean_first_name(self):
|
def clean_first_name(self):
|
||||||
first_name = super().clean()['first_name']
|
first_name = super().clean()['first_name']
|
||||||
match = r'^[a-zA-ZäöüßÄÖÜáéíóúàèìòùÀÈÌÒÙÁÉÍÓÚßñÑ\s\'-]+'
|
match = r'^[a-zA-ZäöüßÄÖÜáéíóúàèìòùÀÈÌÒÙÁÉÍÓÚßñÑçÇ\s\'-]+'
|
||||||
if not re.match(match, first_name):
|
if not re.match(match, first_name):
|
||||||
txt = _("The string must contain only characters and spaces")
|
txt = _("The string must contain only characters and spaces")
|
||||||
raise forms.ValidationError(txt)
|
raise forms.ValidationError(txt)
|
||||||
|
@ -24,7 +24,7 @@ class ProfileForm(forms.ModelForm):
|
||||||
|
|
||||||
def clean_last_name(self):
|
def clean_last_name(self):
|
||||||
last_name = super().clean()['last_name']
|
last_name = super().clean()['last_name']
|
||||||
match = r'^[a-zA-ZäöüßÄÖÜáéíóúàèìòùÀÈÌÒÙÁÉÍÓÚßñÑ\s\'-]+'
|
match = r'^[a-zA-ZäöüßÄÖÜáéíóúàèìòùÀÈÌÒÙÁÉÍÓÚßñÑçÇ\s\'-]+'
|
||||||
if not re.match(match, last_name):
|
if not re.match(match, last_name):
|
||||||
txt = _("The string must contain only characters and spaces")
|
txt = _("The string must contain only characters and spaces")
|
||||||
raise forms.ValidationError(txt)
|
raise forms.ValidationError(txt)
|
||||||
|
|
Loading…
Reference in New Issue