Merged in [12545] from rjsparks@nostrum.com:

Allow a review request to include a comment to show to the review team secretary at assignment time and the reviewer at review time. Fixes #2096.
 - Legacy-Id: 12548
Note: SVN reference [12545] has been migrated to Git commit 6fcd8b8a16
This commit is contained in:
Henrik Levkowetz 2016-12-15 22:45:25 +00:00
parent eafa070790
commit 8dcc1d20a2
8 changed files with 45 additions and 4 deletions

View file

@ -64,6 +64,7 @@ class ReviewTests(TestCase):
"deadline": deadline.isoformat(),
"requested_rev": "01",
"requested_by": Person.objects.get(user__username="reviewsecretary").pk,
"comment": "gZT2iiYqYLKiQHvsgWCcVLdH"
})
self.assertEqual(r.status_code, 302)
@ -74,6 +75,7 @@ class ReviewTests(TestCase):
self.assertEqual(req.deadline, deadline)
self.assertEqual(req.requested_rev, "01")
self.assertEqual(doc.latest_event().type, "requested_review")
self.assertEqual(req.comment, "gZT2iiYqYLKiQHvsgWCcVLdH")
def test_request_review_of_rfc(self):
make_test_data()

View file

@ -46,7 +46,7 @@ class RequestReviewForm(forms.ModelForm):
class Meta:
model = ReviewRequest
fields = ('requested_by', 'type', 'deadline', 'requested_rev')
fields = ('requested_by', 'type', 'deadline', 'requested_rev', 'comment')
def __init__(self, user, doc, *args, **kwargs):
super(RequestReviewForm, self).__init__(*args, **kwargs)

View file

@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('review', '0009_auto_20161214_1537'),
]
operations = [
migrations.AddField(
model_name='reviewrequest',
name='comment',
field=models.CharField(default=b'', help_text=b'Provide any additional information to show to the review team secretary and reviewer', max_length=2048, verbose_name=b"Requester's comments and instructions", blank=True),
),
]

View file

@ -142,6 +142,7 @@ class ReviewRequest(models.Model):
deadline = models.DateField()
requested_by = models.ForeignKey(Person)
requested_rev = models.CharField(verbose_name="requested revision", max_length=16, blank=True, help_text="Fill in if a specific revision is to be reviewed, e.g. 02")
comment = models.TextField(verbose_name="Requester's comments and instructions", max_length=2048, blank=True, help_text="Provide any additional information to show to the review team secretary and reviewer", default='')
# Fields filled in as reviewer is assigned and as the review is
# uploaded. Once these are filled in and we progress beyond being

View file

@ -33,15 +33,19 @@ class ReviewerSettingsResource(ModelResource):
}
api.review.register(ReviewerSettingsResource())
from ietf.doc.resources import DocumentResource
from ietf.group.resources import RoleResource, GroupResource
from ietf.group.resources import GroupResource
from ietf.name.resources import ReviewRequestStateNameResource, ReviewResultNameResource, ReviewTypeNameResource
from ietf.person.resources import PersonResource, EmailResource
class ReviewRequestResource(ModelResource):
state = ToOneField(ReviewRequestStateNameResource, 'state')
type = ToOneField(ReviewTypeNameResource, 'type')
doc = ToOneField(DocumentResource, 'doc')
team = ToOneField(GroupResource, 'team')
reviewer = ToOneField(RoleResource, 'reviewer', null=True)
requested_by = ToOneField(PersonResource, 'requested_by')
reviewer = ToOneField(EmailResource, 'reviewer', null=True)
review = ToOneField(DocumentResource, 'review', null=True)
result = ToOneField(ReviewResultNameResource, 'result', null=True)
class Meta:
@ -51,14 +55,17 @@ class ReviewRequestResource(ModelResource):
#resource_name = 'reviewrequest'
filtering = {
"id": ALL,
"old_id": ALL,
"time": ALL,
"deadline": ALL,
"requested_rev": ALL,
"comment": ALL,
"reviewed_rev": ALL,
"state": ALL_WITH_RELATIONS,
"type": ALL_WITH_RELATIONS,
"doc": ALL_WITH_RELATIONS,
"team": ALL_WITH_RELATIONS,
"requested_by": ALL_WITH_RELATIONS,
"reviewer": ALL_WITH_RELATIONS,
"review": ALL_WITH_RELATIONS,
"result": ALL_WITH_RELATIONS,

View file

@ -35,6 +35,7 @@
{% bootstrap_field form.team layout="horizontal" %}
{% bootstrap_field form.deadline layout="horizontal" %}
{% bootstrap_field form.requested_rev layout="horizontal" %}
{% bootstrap_field form.comment layout="horizontal" %}
{% buttons %}
<button type="submit" class="btn btn-primary">Request review</button>

View file

@ -66,6 +66,14 @@
<td>{{ review_req.requested_by }}</td>
</tr>
{% endif %}
{% if review_req.comment %}
<tr>
<th></th>
<th>Comments</th>
<td><pre class="pasted">{{review_req.comment}}</pre></td>
</tr>
{% endif %}
</tbody>
<tbody class="meta">

View file

@ -60,7 +60,7 @@
<div class="col-sm-6">
<div class="request-metadata">
<p>
{% if r.pk != None %}Requested: <a href="{% url "ietf.doc.views_review.review_request" name=r.doc.name request_id=r.pk %}">{{ r.time|date:"Y-m-d" }}</a>
{% if r.pk != None %}Requested: <a href="{% url "ietf.doc.views_review.review_request" name=r.doc.name request_id=r.pk %}">{{ r.time|date:"Y-m-d" }}{% if r.requested_by %} by {{r.requested_by.plain_name}}{% endif %}</a>
{% else %}
Auto-suggested
{% endif %}
@ -96,6 +96,9 @@
- <a href="{% url "ietf.group.views.group_home" acronym=r.doc.group.acronym group_type=r.doc.group.type_id %}">{{ r.doc.group.acronym }} {{ r.doc.group.type.name }}</a>
{% endif %}
</div>
{% if r.comment %}
<div><pre class="pasted">{{ r.comment }}</pre></div>
{% endif %}
</div>
<div class="col-sm-6 abstract">