Provide templates for directly entered review contents for those teams/review-types that have them. Fixes #2075. Commit ready for merge.

- Legacy-Id: 12594
This commit is contained in:
Robert Sparks 2016-12-19 23:21:11 +00:00
parent 10f4892eae
commit fbd2cd493d
2 changed files with 92 additions and 3 deletions

View file

@ -0,0 +1,82 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
def forward(apps, schema_editor):
DBTemplate = apps.get_model('dbtemplate','DBTemplate')
Group = apps.get_model('group','Group')
DBTemplate.objects.create(
path='/group/genart/review/content_templates/lc.txt',
title='Template for genart last call reviews',
type_id='plain',
group=Group.objects.get(acronym='genart'),
content="""I am the assigned Gen-ART reviewer for this draft. The General Area
Review Team (Gen-ART) reviews all IETF documents being processed
by the IESG for the IETF Chair. Please treat these comments just
like any other last call comments.
For more information, please see the FAQ at
<https://trac.ietf.org/trac/gen/wiki/GenArtfaq>.
Document:
Reviewer:
Review Date:
IETF LC End Date:
IESG Telechat date: (if known)
Summary:
Major issues:
Minor issues:
Nits/editorial comments:
"""
)
DBTemplate.objects.create(
path='/group/genart/review/content_templates/telechat.txt',
title='Template for genart telechat reviews',
type_id='plain',
group=Group.objects.get(acronym='genart'),
content="""I am the assigned Gen-ART reviewer for this draft. The General Area
Review Team (Gen-ART) reviews all IETF documents being processed
by the IESG for the IETF Chair. Please wait for direction from your
document shepherd or AD before posting a new version of the draft.
For more information, please see the FAQ at
<https://trac.ietf.org/trac/gen/wiki/GenArtfaq>.
Document:
Reviewer:
Review Date:
IETF LC End Date:
IESG Telechat date: (if known)
Summary:
Major issues:
Minor issues:
Nits/editorial comments:
"""
)
def reverse(apps, schema_editor):
DBTemplate = apps.get_model('dbtemplate','DBTemplate')
DBTemplate.objects.filter(path__in=['/group/genart/review/content_templates/lc.txt','/group/genart/review/content_templates/telechat.txt']).delete()
class Migration(migrations.Migration):
dependencies = [
('dbtemplate', '0003_review_summary_email'),
]
operations = [
migrations.RunPython(forward,reverse)
]

View file

@ -8,7 +8,7 @@ from django import forms
from django.contrib.auth.decorators import login_required
from django.utils.html import mark_safe
from django.core.exceptions import ValidationError
from django.template.loader import render_to_string
from django.template.loader import render_to_string, TemplateDoesNotExist
from django.core.urlresolvers import reverse as urlreverse
from ietf.doc.models import (Document, NewRevisionDocEvent, State, DocAlias,
@ -573,11 +573,18 @@ def complete_review(request, name, request_id):
return redirect("doc_view", name=review_req.review.name)
else:
form = CompleteReviewForm(review_req, initial={
initial={
"reviewed_rev": review_req.reviewed_rev,
"result": review_req.result_id,
"cc": ", ".join(cc),
})
}
try:
initial['review_content'] = render_to_string('/group/%s/review/content_templates/%s.txt' % (review_req.team.acronym, review_req.type.slug), {})
except TemplateDoesNotExist:
pass
form = CompleteReviewForm(review_req, initial=initial)
mail_archive_query_urls = mailarch.construct_query_urls(review_req)