Mercurial > public > sg101
comparison gpp/accounts/forms.py @ 498:b137a0966e4b
Removed the warning about AT&T and sbcglobal on the registration page. Added "text" classes to the registration text widgets.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Thu, 24 Nov 2011 21:27:07 +0000 |
parents | 7c3816d76c6c |
children | 9e7ae8462f3f |
comparison
equal
deleted
inserted
replaced
497:9894f8cbb931 | 498:b137a0966e4b |
---|---|
16 from antispam.rate_limit import block_ip | 16 from antispam.rate_limit import block_ip |
17 | 17 |
18 | 18 |
19 class RegisterForm(forms.Form): | 19 class RegisterForm(forms.Form): |
20 """Form used to register with the website""" | 20 """Form used to register with the website""" |
21 username = forms.RegexField(max_length=30, regex=r'^\w+$', | 21 username = forms.RegexField( |
22 error_messages={ | 22 max_length=30, |
23 'invalid': 'Your username must be 30 characters or less and ' | 23 regex=r'^\w+$', |
24 'contain only letters, numbers and underscores.'}) | 24 error_messages={'invalid': ('Your username must be 30 characters or' |
25 email = forms.EmailField() | 25 ' less and contain only letters, numbers and underscores.')}, |
26 password1 = forms.CharField(label="Password", widget=forms.PasswordInput) | 26 widget=forms.TextInput(attrs={'class': 'text'}), |
27 password2 = forms.CharField(label="Password confirmation", widget=forms.PasswordInput) | 27 ) |
28 email = forms.EmailField(widget=forms.TextInput(attrs={'class': 'text'})) | |
29 password1 = forms.CharField(label="Password", | |
30 widget=forms.PasswordInput(attrs={'class': 'text'})) | |
31 password2 = forms.CharField(label="Password confirmation", | |
32 widget=forms.PasswordInput(attrs={'class': 'text'})) | |
28 agree_age = forms.BooleanField(required=True, | 33 agree_age = forms.BooleanField(required=True, |
29 label='I certify that I am over the age of 13', | 34 label='I certify that I am over the age of 13', |
30 error_messages={ | 35 error_messages={ |
31 'required': 'Sorry, but you must be over the age of 13 to ' | 36 'required': 'Sorry, but you must be over the age of 13 to ' |
32 'register at our site.', | 37 'register at our site.', |
39 agree_privacy = forms.BooleanField(required=True, | 44 agree_privacy = forms.BooleanField(required=True, |
40 label='I agree to the Privacy Policy', | 45 label='I agree to the Privacy Policy', |
41 error_messages={ | 46 error_messages={ |
42 'required': 'You have not agreed to our Privacy Policy.', | 47 'required': 'You have not agreed to our Privacy Policy.', |
43 }) | 48 }) |
44 question1 = forms.CharField(label="What number appears in the site name?") | 49 question1 = forms.CharField(label="What number appears in the site name?", |
50 widget=forms.TextInput(attrs={'class': 'text'})) | |
45 question2 = forms.CharField(label='', required=False, | 51 question2 = forms.CharField(label='', required=False, |
46 widget=forms.TextInput(attrs={'style': 'display: none;'})) | 52 widget=forms.TextInput(attrs={'style': 'display: none;'})) |
47 | 53 |
48 def __init__(self, *args, **kwargs): | 54 def __init__(self, *args, **kwargs): |
49 self.ip = kwargs.pop('ip', '?') | 55 self.ip = kwargs.pop('ip', '?') |