Skip to content

Commit

Permalink
fix: adjust gating of review requests
Browse files Browse the repository at this point in the history
  • Loading branch information
rjsparks committed Jul 7, 2023
1 parent ffb11fd commit 2c6fe03
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion ietf/doc/tests_review.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,18 @@ def test_request_review_of_rfc(self):
url = urlreverse('ietf.doc.views_review.request_review', kwargs={ "name": doc.name })
login_testing_unauthorized(self, "ad", url)

# get should fail
# get should fail - all non draft types 404
r = self.client.get(url)
self.assertEqual(r.status_code, 404)

# Can only request reviews on active draft documents
doc = WgDraftFactory(states=[("draft","rfc")])
url = urlreverse('ietf.doc.views_review.request_review', kwargs={ "name": doc.name })
r = self.client.get(url)
self.assertEqual(r.status_code, 403)



def test_doc_page(self):

doc = WgDraftFactory(group__acronym='mars',rev='01')
Expand Down
2 changes: 1 addition & 1 deletion ietf/doc/views_review.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def clean(self):

@login_required
def request_review(request, name):
doc = get_object_or_404(Document, name=name)
doc = get_object_or_404(Document, type_id="draft", name=name)

if not can_request_review_of_doc(request.user, doc):
permission_denied(request, "You do not have permission to perform this action")
Expand Down

0 comments on commit 2c6fe03

Please sign in to comment.