diff --git a/ietf/group/tests_review.py b/ietf/group/tests_review.py index 6ca77a0e18..1f44b14700 100644 --- a/ietf/group/tests_review.py +++ b/ietf/group/tests_review.py @@ -101,8 +101,20 @@ def test_suggested_review_requests(self): self.assertEqual(list(suggested_review_requests_for_team(team)), []) + # blocked by an already existing request (don't suggest it again) + review_req.state_id = "requested" + review_req.save() + self.assertEqual(list(suggested_review_requests_for_team(team)), []) + + # ... but not for a previous version + review_req.requested_rev = prev_rev + review_req.save() + self.assertEqual(len(suggested_review_requests_for_team(team)), 1) + + # blocked by completion review_req.state = ReviewRequestStateName.objects.get(slug="assigned") + review_req.requested_rev = "" review_req.save() assignment.state = ReviewAssignmentStateName.objects.get(slug="completed") assignment.reviewed_rev = review_req.doc.rev @@ -116,6 +128,7 @@ def test_suggested_review_requests(self): self.assertEqual(len(suggested_review_requests_for_team(team)), 1) + def test_suggested_review_requests_on_lc_and_telechat(self): review_req = ReviewRequestFactory(state_id='assigned') doc = review_req.doc diff --git a/ietf/review/utils.py b/ietf/review/utils.py index dc70464033..4563a82fd1 100644 --- a/ietf/review/utils.py +++ b/ietf/review/utils.py @@ -590,7 +590,7 @@ def blocks(existing, request): and (not existing.requested_rev or existing.requested_rev == request.doc.rev)) request_closed = existing.state_id not in ('requested','assigned') # Is there a review request for this document already in system - requested = existing.state_id in ('requested') + requested = existing.state_id in ('requested') and (not existing.requested_rev or existing.requested_rev == request.doc.rev) # at least one assignment was completed for the requested version or the current doc version if no specific version was requested: some_assignment_completed = existing.reviewassignment_set.filter(reviewed_rev=existing.requested_rev or existing.doc.rev, state_id='completed').exists()