aboutsummaryrefslogtreecommitdiff
path: root/users/forms.py
diff options
context:
space:
mode:
authorBobby <[email protected]>2023-05-31 11:13:24 -0400
committerBobby <[email protected]>2023-05-31 11:13:24 -0400
commitdae5a88c63a0531c0119e9f25b7b99b483fc8be2 (patch)
treee13aa93ad9c8f5662c2d14db94b5866cfb842c63 /users/forms.py
parent343115fbceceb2e7eb9e5743c06ed5bc9f7f45a2 (diff)
downloadthatcomputerscientist-dae5a88c63a0531c0119e9f25b7b99b483fc8be2.tar.xz
thatcomputerscientist-dae5a88c63a0531c0119e9f25b7b99b483fc8be2.zip
Site policy updates and general updates
Diffstat (limited to 'users/forms.py')
-rw-r--r--users/forms.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/users/forms.py b/users/forms.py
index e10da9f7..2a1be649 100644
--- a/users/forms.py
+++ b/users/forms.py
@@ -37,6 +37,14 @@ class RegisterForm(forms.Form):
'hostmaster',
'info',
'support',
+ 'anonymous',
+ 'guest',
+ 'nobody',
+ 'someone',
+ 'moderator',
+ 'moderators',
+ 'mods',
+ 'crvs'
]
allowed_chars = string.ascii_letters + string.digits
@@ -58,14 +66,14 @@ class RegisterForm(forms.Form):
if str.lower(captcha) != str.lower(self.expected_captcha):
raise forms.ValidationError('Captcha does not match.')
if User.objects.filter(username=cleaned_data.get('username')).exists():
- raise forms.ValidationError('Username already exists.')
+ raise forms.ValidationError('Username not available. Please choose another.')
if cleaned_data.get('username').lower() in self.protected_usernames:
- raise forms.ValidationError('Username not allowed. Please choose another.')
+ raise forms.ValidationError('Username not available. Please choose another.')
for char in cleaned_data.get('username'):
if char not in self.allowed_chars:
raise forms.ValidationError('Username contains invalid characters. Only A-Z, a-z, and 0-9 are allowed.')
if User.objects.filter(email=cleaned_data.get('email')).exists():
- raise forms.ValidationError('Email already exists.')
+ raise forms.ValidationError('Email already exists. Please login if this account is yours.')
return cleaned_data
def save(self, request):