summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPrimal Pappachan2012-04-03 12:32:27 +0530
committerPrimal Pappachan2012-04-03 12:33:28 +0530
commit1cd8369601eba47a22d409e0ee99b2d083f7ede5 (patch)
tree56e4ba34613b744b1b408ec7680f02ec2e5d4d46
parentae3c766bb3af8ab7c4c8fc10a110129142bb3045 (diff)
downloadaloha-1cd8369601eba47a22d409e0ee99b2d083f7ede5.tar.gz
aloha-1cd8369601eba47a22d409e0ee99b2d083f7ede5.tar.bz2
aloha-1cd8369601eba47a22d409e0ee99b2d083f7ede5.zip
check for sec email in apply page
-rw-r--r--aloha/allotter/views.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/aloha/allotter/views.py b/aloha/allotter/views.py
index 08a2164..a91b5e5 100644
--- a/aloha/allotter/views.py
+++ b/aloha/allotter/views.py
@@ -21,14 +21,13 @@ from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib import colors
from reportlab.lib.units import inch
from reportlab.lib.enums import TA_JUSTIFY
-
+all
import time
def user_login(request):
"""
Verify the user credentials and log the user in.
"""
-
user = request.user
if user.is_authenticated():
status = user.get_profile().application.submitted #Getting the submission status
@@ -121,8 +120,11 @@ def apply(request):
if not(user.is_authenticated()):
return redirect('/allotter/login/')
- context = get_details(user)
-
+ sec_email = user.get_profile().secondary_email
+ if not sec_email: #Not Entered Secondary email
+ return redirect('/allotter/details/')
+
+ context = get_details(user)
return render(request, 'allotter/apply.html', context)
@@ -188,7 +190,7 @@ def complete_allotment(request):
user = get_object_or_404(User, username=reg_no)
sec_email = user.get_profile().secondary_email
if not sec_email: #Not Entered Secondary email
- redirect('/allotter/details/')
+ return redirect('/allotter/details/')
options_chosen = get_chosen_options(user)
context = {'username': reg_no, 'email': sec_email,
'options_chosen': options_chosen}