diff options
author | Nishanth Amuluru | 2011-01-07 09:22:40 +0530 |
---|---|---|
committer | Nishanth Amuluru | 2011-01-07 09:22:40 +0530 |
commit | 646f5fdc3b120ab6475f584c0f5aa7b7c2ba8f52 (patch) | |
tree | 430f49f14fe8ec5a6bf40cfaf0b9439093aaad46 /profile/forms.py | |
parent | 7f2b138b93e0e92e4452e1b3633ed10f7b72a35f (diff) | |
download | pytask-646f5fdc3b120ab6475f584c0f5aa7b7c2ba8f52.tar.gz pytask-646f5fdc3b120ab6475f584c0f5aa7b7c2ba8f52.tar.bz2 pytask-646f5fdc3b120ab6475f584c0f5aa7b7c2ba8f52.zip |
Fixed a few typos
Diffstat (limited to 'profile/forms.py')
-rw-r--r-- | profile/forms.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/profile/forms.py b/profile/forms.py index f4351a9..ed4b455 100644 --- a/profile/forms.py +++ b/profile/forms.py @@ -10,12 +10,12 @@ from registration.models import RegistrationProfile from pytask.utils import make_key from pytask.profile.models import GENDER_CHOICES, Profile -class RegistrationFormCustom(RegistrationFormUniqueEmail): +class CustomRegistrationForm(RegistrationFormUniqueEmail): """Used instead of RegistrationForm used by default django-registration backend, this adds aboutme, dob, gender, address, phonenum to the default django-registration RegistrationForm""" - aboutme = forms.TextField(required=True, max_length=1000, label=u"About Me", + aboutme = forms.CharField(required=True, max_length=1000, label=u"About Me", help_text="A write up about yourself to aid the\ reviewer in judging your eligibility for a task.\ It can have your educational background, CGPA,\ @@ -26,17 +26,17 @@ class RegistrationFormCustom(RegistrationFormUniqueEmail): dob = forms.DateField(help_text = "YYYY-MM-DD", required=True, label=u'date of birth') gender = forms.ChoiceField(choices = GENDER_CHOICES, required=True, label=u'gender') - address = forms.TextField(required=True, max_length=200, help_text="This \ + address = forms.CharField(required=True, max_length=200, help_text="This \ information will be used while sending DD/Cheque") - phonenum = forms.TextField(required=True, max_length=10. label="Phone - Number") + phonenum = forms.CharField(required=True, max_length=10, + label="Phone Number") def clean_aboutme(self): """ Empty not allowed """ data = self.cleaned_data['aboutme'] if not data.strip(): - raise forms.ValidationError("Please write something about + raise forms.ValidationError("Please write something about\ yourself") return data @@ -55,8 +55,8 @@ class RegistrationFormCustom(RegistrationFormUniqueEmail): data = self.cleaned_data['phonenum'] - if (not data.strip()) or - (data.strip("1234567890")) or + if (not data.strip()) or \ + (data.strip("1234567890")) or \ (len(data)!= 10): raise forms.ValidationError("This is not a valid phone number") @@ -74,7 +74,7 @@ class RegistrationFormCustom(RegistrationFormUniqueEmail): aboutme=self.cleaned_data['aboutme'], dob=self.cleaned_data['dob'], gender=self.cleaned_data['gender'], - address=self.cleaned_data['address'] + address=self.cleaned_data['address'], phonenum=self.cleaned_data['phonenum'], uniq_key=make_key(Profile), ) |