From 0f9f684359dda064d154afe4bef15e34244ec671 Mon Sep 17 00:00:00 2001
From: "J.-S. Caux" <J.S.Caux@uva.nl>
Date: Mon, 25 Jan 2016 10:05:55 +0100
Subject: [PATCH] Solve bug in vet comments

---
 comments/templates/comments/vet_submitted_comments.html | 8 ++++++--
 comments/views.py                                       | 3 +--
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/comments/templates/comments/vet_submitted_comments.html b/comments/templates/comments/vet_submitted_comments.html
index 4a185057f..46fb20515 100644
--- a/comments/templates/comments/vet_submitted_comments.html
+++ b/comments/templates/comments/vet_submitted_comments.html
@@ -5,9 +5,12 @@
 {% block bodysup %}
 
 <section>
-  <h1>SciPost Comment to vet:</h1>
+  {% if not comment_to_vet %}
+  <h1>There are no comments for you to vet.</h1>
+
+  {% else %}
 
-  <br>
+  <h1>SciPost Comment to vet:</h1>
   <hr>
   {% if comment_to_vet.commentary %}
   <h3>Commentary associated to Comment:</h3>
@@ -52,6 +55,7 @@
     </div>
   </div>
 
+  {% endif %}
 </section>
 
 {% endblock bodysup %}
diff --git a/comments/views.py b/comments/views.py
index c193bd753..57ec2d951 100644
--- a/comments/views.py
+++ b/comments/views.py
@@ -25,7 +25,7 @@ def vet_submitted_comments(request):
     comment_to_vet = Comment.objects.filter(status=0).first() # only handle one at a time
     if comment_to_vet is not None:
         form = VetCommentForm()
-        context = {'contributor': contributor, 'submitted_comment_to_vet': comment_to_vet, 'form': form }
+        context = {'contributor': contributor, 'comment_to_vet': comment_to_vet, 'form': form }
         return(render(request, 'comments/vet_submitted_comments.html', context))
     return render (request, 'comments/no_comment_to_vet.html')
 
@@ -70,7 +70,6 @@ def vet_submitted_comment_ack(request, comment_id):
     return render(request, 'comments/vet_submitted_comment_ack.html', context)
 
 
-
 def reply_to_comment(request, comment_id):
     comment = get_object_or_404(Comment, pk=comment_id)
     if request.method == 'POST':
-- 
GitLab