diff --git a/conservancy/usethesource/views.py b/conservancy/usethesource/views.py index 33158f78d42b9ab14715592b326bf793dbd6fa6f..6b3c10d66963402a9ee309e356546071883fa4ea 100644 --- a/conservancy/usethesource/views.py +++ b/conservancy/usethesource/views.py @@ -35,7 +35,7 @@ def download_page(request, slug, download_type): def create_comment(request, slug): candidate = get_object_or_404(Candidate, slug=slug) if request.method == 'GET': - form = CommentForm() + form = CommentForm(initial={'post_to_list': True}) else: form = CommentForm(request.POST) if form.is_valid(): @@ -43,8 +43,9 @@ def create_comment(request, slug): comment.candidate = candidate comment.user = request.user comment.save() - email = make_comment_email(comment) - email.send() + if 'post_to_list' in request.POST: + email = make_comment_email(comment) + email.send() return redirect('usethesource:view_comment', comment_id=comment.id, show_add='true') return render(request, 'usethesource/add_comment_form.html', {'form': form, 'candidate': candidate})