summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPrimal Pappachan2012-04-12 13:15:43 +0530
committerPrimal Pappachan2012-04-12 13:15:43 +0530
commit145c6b4276a602d8c41349b91db158c7fc35afa4 (patch)
treeb70aa4bfc7d9f6f237e5e3656483599c50d7b80b
parentcf3757f57aff3d9ed6467288488be4624998a9f5 (diff)
parent8033c75af75bf1893ce28db4a137a016f723f05a (diff)
downloadaloha-145c6b4276a602d8c41349b91db158c7fc35afa4.tar.gz
aloha-145c6b4276a602d8c41349b91db158c7fc35afa4.tar.bz2
aloha-145c6b4276a602d8c41349b91db158c7fc35afa4.zip
Merge github.com:FOSSEE/aloha
-rw-r--r--aloha/allotter/views.py18
-rw-r--r--aloha/template/allotter/hello.html11
-rw-r--r--aloha/template/allotter/logout.html22
3 files changed, 35 insertions, 16 deletions
diff --git a/aloha/allotter/views.py b/aloha/allotter/views.py
index 18e3b2c..c3fc804 100644
--- a/aloha/allotter/views.py
+++ b/aloha/allotter/views.py
@@ -137,8 +137,11 @@ def apply(request):
def user_logout(request):
##Logouts the user.
- quit_status = request.POST['check']
- user = request.user
+ try:
+ quit_status = request.POST['check']
+ user = request.user
+ except :
+ return redirect('/allotter/login/')
user_profile = user.get_profile()
user_application = user_profile.application
if str(quit_status) == "on":
@@ -147,7 +150,7 @@ def user_logout(request):
user_application.quit_status = False
user_application.save()
logout(request)
- return redirect ('/allotter/login/')
+ return render(request, 'allotter/logout.html')
#TODO: Extensive Testing
@@ -176,8 +179,13 @@ def submit_options(request):
options_chosen_list = [] #Initializing empty list for storing options
for option in options_available_list:
- option_pref = request.POST[unicode(option.opt_code)]
- options_chosen_list.append([int(option_pref), str(option.opt_code)]) #[preference, option code]
+ option_pref = request.POST[unicode(option.opt_code)]
+ try:
+ options_chosen_list.append([int(option_pref), str(option.opt_code)]) #[preference, option code]
+ except ValueError:
+ context = get_details(user)
+ return render(request, 'allotter/apply.html', context)
+
options_chosen_list.sort() #Sorting by preference
diff --git a/aloha/template/allotter/hello.html b/aloha/template/allotter/hello.html
deleted file mode 100644
index 0d07c7f..0000000
--- a/aloha/template/allotter/hello.html
+++ /dev/null
@@ -1,11 +0,0 @@
-{% extends "base.html" %}
-
-{% block title %} Welcome Note {% endblock %}
-
-{% block content %}
-<h2>Hello, there</h2>
-
-<p> Welcome <strong>{{user.first_name.title}} {{user.last_name.title}}</strong>,
-to JAM 2012 allotment! </p>
-
-{% endblock content %}
diff --git a/aloha/template/allotter/logout.html b/aloha/template/allotter/logout.html
new file mode 100644
index 0000000..4632586
--- /dev/null
+++ b/aloha/template/allotter/logout.html
@@ -0,0 +1,22 @@
+{% extends "base.html" %}
+
+
+{% block title %}Application sucessfully submitted{% endblock title %}
+
+{% block content %}
+<h2>Your application has been succesfully submitted.</h2>
+<hr />
+<h3>You can <a href="/allotter/login/">login</a> again to download the Application Form and the Allotment Form.</h3>
+<hr />
+<p><b>For any queries please contact</b>
+<br/>
+Organizing Chairman, GATE - JAM Office<br/>
+Indian Institute of Technology Bombay,<br/>
+P.O. IIT Powai, MUMBAI - 400 076<br/>
+Phone: 022-25767022, 25767068<br/>
+Fax : 022-25722674<br/>
+e-mail : jam[at]iitb.ac.in<br/>
+Website : www.iitb.ac.in/jam
+</p>
+{% endblock content %}
+