File diff 250db691e485 → c0a4fe5f39d0
conservancy/usethesource/views.py
Show inline comments
...
 
@@ -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})