SciPost Code Repository

Skip to content
Snippets Groups Projects
Commit a0c18b45 authored by Geert Kapteijns's avatar Geert Kapteijns
Browse files

Merge branch 'fix-unvetted-commentary' into development

parents 017179c0 f9008f9e
No related branches found
No related tags found
No related merge requests found
......@@ -160,3 +160,9 @@ class CommentaryDetailTest(TestCase):
def test_status_code_200(self):
response = self.client.get(self.target)
self.assertEqual(response.status_code, 200)
def test_unvetted_commentary(self):
commentary = UnvettedCommentaryFactory(requested_by=ContributorFactory())
target = reverse('commentaries:commentary', kwargs={'arxiv_or_DOI_string': commentary.arxiv_or_DOI_string})
response = self.client.get(target)
self.assertEqual(response.status_code, 404)
......@@ -206,6 +206,9 @@ class CommentaryListView(ListView):
def commentary_detail(request, arxiv_or_DOI_string):
commentary = get_object_or_404(Commentary, arxiv_or_DOI_string=arxiv_or_DOI_string)
if not commentary.vetted:
raise Http404
comments = commentary.comment_set.all()
form = CommentForm()
try:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment