Skip to content

Commit bee0dc9

Browse files
committed
Added a person name validation step to prevent names using 'anonymous'.
- Legacy-Id: 18597
1 parent d6efe1f commit bee0dc9

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

ietf/ietfauth/forms.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,11 @@ def prevent_system_name(name):
6565
if "(system)" in name_without_spaces.lower():
6666
raise forms.ValidationError("Please pick another name - this name is reserved.")
6767

68+
def prevent_anonymous_name(name):
69+
name_without_spaces = name.replace(" ", "").replace("\t", "")
70+
if "anonymous" in name_without_spaces.lower():
71+
raise forms.ValidationError("Please pick another name - this name is reserved.")
72+
6873
class PersonPasswordForm(forms.ModelForm, PasswordForm):
6974

7075
class Meta:
@@ -75,6 +80,7 @@ def clean_name(self):
7580
name = self.cleaned_data.get('name', '')
7681
prevent_at_symbol(name)
7782
prevent_system_name(name)
83+
prevent_anonymous_name(name)
7884

7985
return name
8086

0 commit comments

Comments
 (0)