From ebbbdd6b7d3ca52c2b1524e86169d10466bad323 Mon Sep 17 00:00:00 2001 From: Primal Pappachan Date: Fri, 13 Apr 2012 10:08:54 +0530 Subject: added check for validity of dates --- aloha/allotter/forms.py | 7 +++++-- 1 file 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) -- cgit