summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPrimal Pappachan2012-04-13 10:08:54 +0530
committerPrimal Pappachan2012-04-13 10:08:54 +0530
commitebbbdd6b7d3ca52c2b1524e86169d10466bad323 (patch)
treeff0c3539f41ef3e764ab40805db86559628eb4ba
parent145c6b4276a602d8c41349b91db158c7fc35afa4 (diff)
downloadaloha-ebbbdd6b7d3ca52c2b1524e86169d10466bad323.tar.gz
aloha-ebbbdd6b7d3ca52c2b1524e86169d10466bad323.tar.bz2
aloha-ebbbdd6b7d3ca52c2b1524e86169d10466bad323.zip
added check for validity of dates
-rw-r--r--aloha/allotter/forms.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/aloha/allotter/forms.py b/aloha/allotter/forms.py
index 431a939..9747cf3 100644
--- a/aloha/allotter/forms.py
+++ b/aloha/allotter/forms.py
@@ -82,9 +82,12 @@ class UserLoginForm(forms.Form):
super(UserLoginForm, self).clean()
u_name = self.cleaned_data.get('username')
pwd = settings.DEFAULT_PASSWORD
- dob = self.cleaned_data["dob"]
+ try:
+ dob = self.cleaned_data['dob']
+ dd_date = self.cleaned_data.get("dd_date")
+ except:
+ raise forms.ValidationError("One or more of the entered dates is/are invalid.")
dd_no = self.cleaned_data.get("dd_no")
- dd_date = self.cleaned_data.get("dd_date")
dd_amount = self.cleaned_data.get("dd_amount")
try:
current_user = User.objects.get(username__exact = u_name)