summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorparth2012-04-26 19:57:59 +0530
committerparth2012-04-26 19:57:59 +0530
commit15d8c01fe49d21b99fa0a11d5e577747a921627e (patch)
tree3652dbce92bbbcf61d0c130ba8856e1f89747716
parentf6e15deabda00865fc6303b20b912c4997a27c99 (diff)
parent7b79ea4b2ef24cbbfe70d1b22369e23e2fcb48ba (diff)
downloadaloha-15d8c01fe49d21b99fa0a11d5e577747a921627e.tar.gz
aloha-15d8c01fe49d21b99fa0a11d5e577747a921627e.tar.bz2
aloha-15d8c01fe49d21b99fa0a11d5e577747a921627e.zip
Merge branch 'master' of github.com:FOSSEE/alohaHEADmaster
-rw-r--r--aloha/allotter/forms.py15
-rw-r--r--aloha/allotter/views.py4
-rw-r--r--aloha/template/allotter/complete.html2
3 files changed, 12 insertions, 9 deletions
diff --git a/aloha/allotter/forms.py b/aloha/allotter/forms.py
index 5112884..a2b205c 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)
@@ -96,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.")
@@ -204,16 +207,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
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:
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
<div class="alert alert-error">
-<p><input type="checkbox" name="check" id="check"/><label for="check">I have downloaded 2 PDF's that together consitute my application.</label>
+<p><input type="checkbox" name="check" id="check"/><label for="check">I have downloaded 2 PDF's that together constitute my application.</label>
</p>
<input type="submit" name="logout" value="Quit Admission Application" class="btn" id="checkButton" disabled="disabled" />
<p>This will finish the application procedure and the choices