diff options
author | hardythe1 | 2015-06-20 17:43:55 +0530 |
---|---|---|
committer | hardythe1 | 2015-06-20 17:43:55 +0530 |
commit | 4e3c41d5d78ba89c985ce7a31d3530a691bd8793 (patch) | |
tree | f412d8fd1a9f10d8fc254d485c76960b68c4106f /website/views.py | |
parent | bbe849ca534d2573f9815e8c44c890f1834adf4f (diff) | |
download | SciPy2015-4e3c41d5d78ba89c985ce7a31d3530a691bd8793.tar.gz SciPy2015-4e3c41d5d78ba89c985ce7a31d3530a691bd8793.tar.bz2 SciPy2015-4e3c41d5d78ba89c985ce7a31d3530a691bd8793.zip |
change to give query sent consent
Diffstat (limited to 'website/views.py')
-rw-r--r-- | website/views.py | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/website/views.py b/website/views.py index 0fda4f7..2fcca04 100644 --- a/website/views.py +++ b/website/views.py @@ -13,16 +13,6 @@ from django.core.mail import send_mail def home(request): context = {} - if 'query' in request.GET: - context['query'] = True - context.update(csrf(request)) - if request.method == "POST": - return HttpResponse("Working") - return render_to_response('base.html', context) - - -def contact(request): - context = {} context.update(csrf(request)) if request.method == "POST": sender_name = request.POST['name'] @@ -31,7 +21,10 @@ def contact(request): to = ('scipy@fossee.in',) subject = "Query from - "+sender_name message = request.POST['message'] - send_mail(subject, message, sender_email, to, fail_silently=True) - return HttpResponseRedirect('/2015/?query=sent') - else: - return HttpResponseRedirect('/2015') + try: + send_mail(subject, message, sender_email, to) + context['mailsent'] = True + except: + context['mailfailed'] = True + return render_to_response('base.html', context) + return render_to_response('base.html', context) |