From d25d1e95b635e2b42f41e325542821aac63c9732 Mon Sep 17 00:00:00 2001 From: Primal Pappachan Date: Thu, 12 Apr 2012 13:05:18 +0530 Subject: typo fix --- aloha/template/allotter/complete.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aloha/template/allotter/complete.html b/aloha/template/allotter/complete.html index 01c884b..d95ef0f 100644 --- a/aloha/template/allotter/complete.html +++ b/aloha/template/allotter/complete.html @@ -104,7 +104,7 @@ your completed application form to the "Organizing chairman, GATE-JAM 2012, IIT
-

+

This will finish the application procedure and the choices -- cgit From cf3757f57aff3d9ed6467288488be4624998a9f5 Mon Sep 17 00:00:00 2001 From: Primal Pappachan Date: Thu, 12 Apr 2012 13:05:32 +0530 Subject: check for non empty --- aloha/allotter/forms.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/aloha/allotter/forms.py b/aloha/allotter/forms.py index 5112884..431a939 100644 --- a/aloha/allotter/forms.py +++ b/aloha/allotter/forms.py @@ -204,16 +204,16 @@ class UserDetailsForm(forms.Form): tenth = self.cleaned_data['tenth_perc'] twelfth = self.cleaned_data['twelfth_perc'] bachelor = self.cleaned_data['bachelor_perc'] - if email and phone_number and tenth and twelfth and bachelor: user_profile.secondary_email = email - user_profile.phone_number = phone_number + user_profile.phone_number = phone_number user_profile.tenth_perc = tenth user_profile.twelfth_perc = twelfth - user_profile.bachelors_perc = bachelor + user_profile.bachelors_perc = bachelor else: raise forms.ValidationError("Make sure that you have entered all the details.") + user_application = user_profile.application user_application.cgy = category -- cgit 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 From b0a67f1f3fe056ed049ad1e703237ec093c7cc14 Mon Sep 17 00:00:00 2001 From: Primal Pappachan Date: Fri, 13 Apr 2012 10:22:06 +0530 Subject: or instead of and for dd_no and dd_amount check --- aloha/allotter/forms.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aloha/allotter/forms.py b/aloha/allotter/forms.py index 9747cf3..a2b205c 100644 --- a/aloha/allotter/forms.py +++ b/aloha/allotter/forms.py @@ -99,7 +99,7 @@ class UserLoginForm(forms.Form): ##Validating the DD Details - if not dd_no and not dd_amount: + if not dd_no or not dd_amount: raise forms.ValidationError("Fill in the Demand Draft Details") elif len(dd_no) != 6 or dd_no.count('0') == 6 or dd_no.strip(digits): raise forms.ValidationError("Demand Draft Number you have entered is not valid.") -- cgit From 7b79ea4b2ef24cbbfe70d1b22369e23e2fcb48ba Mon Sep 17 00:00:00 2001 From: Primal Pappachan Date: Fri, 13 Apr 2012 15:37:46 +0530 Subject: fixed logout no profile issue --- aloha/allotter/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aloha/allotter/views.py b/aloha/allotter/views.py index c3fc804..0b33a9f 100644 --- a/aloha/allotter/views.py +++ b/aloha/allotter/views.py @@ -140,10 +140,10 @@ def user_logout(request): try: quit_status = request.POST['check'] user = request.user + user_profile = user.get_profile() + user_application = user_profile.application except : return redirect('/allotter/login/') - user_profile = user.get_profile() - user_application = user_profile.application if str(quit_status) == "on": user_application.quit_status = True else: -- cgit