diff options
Diffstat (limited to 'website')
-rwxr-xr-x | website/views.py | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/website/views.py b/website/views.py index bd96143..f2d53f7 100755 --- a/website/views.py +++ b/website/views.py @@ -17,7 +17,7 @@ from django.db.models import F import csv from django.core.mail import EmailMultiAlternatives import os -from scipy2017.local import SENDER_EMAIL +from scipy2017.local import * from website.forms import ProposalForm, UserRegisterForm, UserLoginForm, WorkshopForm, ContactForm from website.models import Proposal, Comments, Ratings @@ -99,7 +99,7 @@ def home(request): if request.method == "POST": sender_name = request.POST['name'] sender_email = request.POST['email'] - to = ('scipy@fossee.in', sender_email) + to = (TO_EMAIL, sender_email) subject = "Query from - "+sender_name message = request.POST['message'] try: @@ -158,9 +158,9 @@ def submitcfp(request): data.save() context['proposal_submit'] = True sender_name = "SciPy India 2017" - sender_email = SENDER_EMAIL + sender_email = TO_EMAIL subject = "SciPy India 2017 – Talk Proposal Submission Acknowledgment" - to = (social_user.email, SENDER_EMAIL) + to = (social_user.email, TO_EMAIL) message = """ Dear {0}, <br><br> Thank you for showing interest & submitting a talk proposal at SciPy India 2017 conference for the talk titled <b>“{1}”</b>. Reviewal of the proposals will start once the CFP closes. @@ -177,7 +177,7 @@ def submitcfp(request): headers={"Content-type":"text/html;charset=iso-8859-1"} ) email.attach_alternative(message, "text/html") - #email.send(fail_silently=True) + email.send(fail_silently=True) return render_to_response('cfp.html', context) else: context['proposal_form'] = form @@ -211,9 +211,9 @@ def submitcfw(request): data.save() context['proposal_submit'] = True sender_name = "SciPy India 2017" - sender_email = SENDER_EMAIL + sender_email = TO_EMAIL subject = "SciPy India 2017 – Workshop Proposal Submission Acknowledgment" - to = (social_user.email, SENDER_EMAIL) + to = (social_user.email, TO_EMAIL) message = """ Dear {0}, <br><br> Thank you for showing interest & submitting a workshop proposal at SciPy India 2017 conference for the workshop titled <b>“{1}”</b>. Reviewal of the proposals will start once the CFP closes. @@ -230,7 +230,7 @@ def submitcfw(request): headers={"Content-type":"text/html;charset=iso-8859-1"} ) email.attach_alternative(message, "text/html") - #email.send(fail_silently=True) + email.send(fail_silently=True) return render_to_response('cfp.html', context) else: context['proposal_form'] = form @@ -410,8 +410,8 @@ def comment_abstract(request, proposal_id = None): comment.save() comments = Comments.objects.filter(proposal=proposal) sender_name = "SciPy India 2017" - sender_email = SENDER_EMAIL - to = (proposal.user.email, SENDER_EMAIL ) + sender_email = TO_EMAIL + to = (proposal.user.email, TO_EMAIL ) if proposal.proposal_type == 'ABSTRACT': subject = "SciPy India 2017 - Comment on Your talk Proposal" message = """ @@ -444,7 +444,7 @@ def comment_abstract(request, proposal_id = None): headers={"Content-type":"text/html;charset=iso-8859-1"} ) email.attach_alternative(message, "text/html") - #email.send(fail_silently=True) + email.send(fail_silently=True) proposal.status="Commented" proposal.save() rates = Ratings.objects.filter(proposal=proposal) @@ -484,8 +484,8 @@ def status(request, proposal_id= None): proposal.status="Accepted" proposal.save() sender_name = "SciPy India 2017" - sender_email = SENDER_EMAIL - to = (proposal.user.email, SENDER_EMAIL) + sender_email = TO_EMAIL + to = (proposal.user.email, TO_EMAIL) if proposal.proposal_type == 'ABSTRACT': subject = "SciPy India 2017 - Talk Proposal Accepted" message = """Dear """+proposal.user.first_name+""", @@ -502,8 +502,8 @@ def status(request, proposal_id= None): proposal.status="Rejected" proposal.save() sender_name = "SciPy India 2017" - sender_email = SENDER_EMAIL - to = (proposal.user.email,SENDER_EMAIL, ) + sender_email = TO_EMAIL + to = (proposal.user.email,TO_EMAIL, ) if proposal.proposal_type == 'ABSTRACT': subject = "SciPy India 2017 - Talk Proposal Rejected" message = """Dear """+proposal.user.first_name+""", @@ -519,9 +519,9 @@ def status(request, proposal_id= None): send_mail(subject, message, sender_email, to) context.update(csrf(request)) elif 'resubmit' in request.POST: - to = (proposal.user.email, SENDER_EMAIL ) + to = (proposal.user.email, TO_EMAIL ) sender_name = "SciPy India 2017" - sender_email = SENDER_EMAIL + sender_email = TO_EMAIL if proposal.proposal_type == 'ABSTRACT': subject = "SciPy India 2017 - Talk Proposal Resumbmission" message = """ @@ -553,7 +553,7 @@ def status(request, proposal_id= None): headers={"Content-type":"text/html;charset=iso-8859-1"} ) email.attach_alternative(message, "text/html") - #email.send(fail_silently=True) + email.send(fail_silently=True) proposal.status="Edit" proposal.save() context.update(csrf(request)) @@ -647,8 +647,8 @@ def status_change(request): proposal.status = "Accepted" proposal.save() sender_name = "SciPy India 2017" - sender_email = SENDER_EMAIL - to = (proposal.user.email, SENDER_EMAIL) + sender_email = TO_EMAIL + to = (proposal.user.email, TO_EMAIL) if proposal.proposal_type == 'ABSTRACT': subject = "SciPy India 2017 - Talk Proposal Accepted" message = """Dear """+proposal.user.first_name+""", @@ -659,7 +659,7 @@ def status_change(request): message = """Dear """+proposal.user.first_name+""", Congratulations. Your proposal for the workshop titled '"""+ proposal.title+ """'is accepted. You shall conduct the workshop at the conference.\n\nYou will be notified regarding instructions of your workshop via email.\n\nThank You ! \n\nRegards,\nSciPy India 2017,\nFOSSEE - IIT Bombay""" - #send_mail(subject, message, sender_email, to) + send_mail(subject, message, sender_email, to) context.update(csrf(request)) proposals = Proposal.objects.all() context['proposals'] = proposals @@ -672,8 +672,8 @@ def status_change(request): proposal.status="Rejected" proposal.save() sender_name = "SciPy India 2017" - sender_email = SENDER_EMAIL - to = (proposal.user.email, SENDER_EMAIL) + sender_email = TO_EMAIL + to = (proposal.user.email, TO_EMAIL) if proposal.proposal_type == 'ABSTRACT': subject = "SciPy India 2017 - Talk Proposal Rejected" message = """Dear """+proposal.user.first_name+""", @@ -686,7 +686,7 @@ def status_change(request): We regret to inform you that your proposal for the workshop titled '"""+ proposal.title+ """' as not been shortlisted.<br> You may register and attend the conference by clicking http://scipyindia2017.doattend.com/ \n\nThank You ! \n\nRegards,\nSciPy India 2017,\nFOSSEE - IIT Bombay""" - #send_mail(subject, message, sender_email, to) + send_mail(subject, message, sender_email, to) context.update(csrf(request)) proposals = Proposal.objects.all() context['proposals'] = proposals @@ -697,8 +697,8 @@ def status_change(request): for proposal_id in delete_proposal: proposal = Proposal.objects.get(id = proposal_id) sender_name = "SciPy India 2017" - sender_email = SENDER_EMAIL - to = (proposal.user.email, SENDER_EMAIL ) + sender_email = TO_EMAIL + to = (proposal.user.email, TO_EMAIL ) if proposal.proposal_type == 'ABSTRACT': subject = "SciPy India 2017 - Talk Proposal Resumbmission" message = """ @@ -730,7 +730,7 @@ def status_change(request): headers={"Content-type":"text/html;charset=iso-8859-1"} ) email.attach_alternative(message, "text/html") - #email.send(fail_silently=True) + email.send(fail_silently=True) proposal.status="Edit" proposal.save() context.update(csrf(request)) |