Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def clean_listname(self):
- cleaned_data = super(ListNew, self).clean()
- listname = cleaned_data.get('listname')
- try:
- validate_slug(listname)
- except:
- raise forms.ValidationError(_("Please enter a valid listname"))
- return listname
- -----------------------------------------------------------------------------------
- def clean_password(self):
- password = self.cleaned_data.get('password')
- password_repeat = self.cleaned_data.get('password_repeat')
- if password != password_repeat:
- raise forms.ValidationError("Passwords must be identical.")
- return password_repeat
- def clean_email(self):
- email = self.cleaned_data['email']
- try:
- validate_email(email)
- except:
- raise forms.ValidationError(_("Please enter a valid email ID"))
- return email
- ------------------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement