diff options
author | Primal Pappachan | 2012-04-03 12:29:44 +0530 |
---|---|---|
committer | Primal Pappachan | 2012-04-03 12:29:44 +0530 |
commit | 1b8a940373ed5e3eee17562f15ee927ac9dfd0ff (patch) | |
tree | 76ec712ef4ee93839a76c8d1e053a8057502bfe5 | |
parent | 733efc93b641d76e129277ad75c679bd2560ae65 (diff) | |
download | aloha-1b8a940373ed5e3eee17562f15ee927ac9dfd0ff.tar.gz aloha-1b8a940373ed5e3eee17562f15ee927ac9dfd0ff.tar.bz2 aloha-1b8a940373ed5e3eee17562f15ee927ac9dfd0ff.zip |
added fail silently and check for secondary email
-rw-r--r-- | aloha/allotter/views.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/aloha/allotter/views.py b/aloha/allotter/views.py index 8be51ef..08a2164 100644 --- a/aloha/allotter/views.py +++ b/aloha/allotter/views.py @@ -187,6 +187,8 @@ def complete_allotment(request): reg_no = request.user.username 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/') options_chosen = get_chosen_options(user) context = {'username': reg_no, 'email': sec_email, 'options_chosen': options_chosen} @@ -202,7 +204,7 @@ def complete_allotment(request): counter += 1 content += "\n \n \nPlease do not delete this email and keep it for reference purposes. \n \n \n \n Regards, \n JAM Office, IIT Bombay" - send_mail(subject, content, from_email, [sec_email]) + send_mail(subject, content, from_email, [sec_email], fail_silently=True) admin_content = content admin_content +="\n\n\n#%s:" % (reg_no) counter = 1 @@ -211,7 +213,7 @@ def complete_allotment(request): counter += 1 admin_content +="#" admin_content += time.ctime() - mail_admins(subject, admin_content) + mail_admins(subject, admin_content, fail_silently=True) return render(request, 'allotter/complete.html', context) |