Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 24 additions & 2 deletions ietf/doc/tests_status_change.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from django.conf import settings
from django.urls import reverse as urlreverse

from ietf.doc.factories import DocumentFactory, IndividualRfcFactory, WgRfcFactory
from ietf.doc.factories import DocumentFactory, IndividualRfcFactory, WgRfcFactory, DocEventFactory
from ietf.doc.models import ( Document, DocAlias, State, DocEvent,
BallotPositionDocEvent, NewRevisionDocEvent, TelechatDocEvent, WriteupDocEvent )
from ietf.doc.utils import create_ballot_if_not_open
Expand Down Expand Up @@ -86,6 +86,16 @@ def test_start_review(self):
status_change = Document.objects.get(name='status-change-imaginary-new2')
self.assertIsNone(status_change.ad)

# Verify that the right thing happens if a control along the way uppercases RFC
r = self.client.post(url,dict(
document_name="imaginary-new3",title="A new imaginary status change",
create_in_state=state_strpk,notify='ipu@ietf.org',new_relation_row_blah="RFC9999",
statchg_relation_row_blah="tois")
)
self.assertEqual(r.status_code, 302)
status_change = Document.objects.get(name='status-change-imaginary-new3')
self.assertTrue(status_change.relateddocument_set.filter(relationship__slug='tois',target__name='rfc9999'))


def test_change_state(self):

Expand Down Expand Up @@ -289,7 +299,19 @@ def test_edit_lc(self):
self.assertEqual(r.status_code,200)
self.assertContains(r, 'RFC9999 from Proposed Standard to Internet Standard')
self.assertContains(r, 'RFC9998 from Informational to Historic')

q = PyQuery(r.content)
self.assertEqual(len(q("button[name='send_last_call_request']")), 1)

# Make sure request LC isn't offered with no responsible AD.
doc.ad = None
doc.save_with_history([DocEventFactory(doc=doc)])
r = self.client.get(url)
self.assertEqual(r.status_code,200)
q = PyQuery(r.content)
self.assertEqual(len(q("button[name='send_last_call_request']")), 0)
doc.ad = Person.objects.get(name='Ad No2')
doc.save_with_history([DocEventFactory(doc=doc)])

# request last call
messages_before = len(outbox)
r = self.client.post(url,dict(last_call_text='stuff',send_last_call_request='Save+and+Request+Last+Call'))
Expand Down
4 changes: 2 additions & 2 deletions ietf/doc/views_status_change.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ def clean_helper(form, formtype):
rfc_fields = {}
status_fields={}
for k in sorted(form.data.keys()):
v = form.data[k]
v = form.data[k].lower()
if k.startswith('new_relation_row'):
if re.match(r'\d{1,4}',v):
v = 'rfc'+v
Expand Down Expand Up @@ -685,7 +685,7 @@ def last_call(request, name):
form = LastCallTextForm(initial=dict(last_call_text=escape(last_call_event.text)))

if request.method == 'POST':
if "save_last_call_text" in request.POST or "send_last_call_request" in request.POST:
if "save_last_call_text" in request.POST or ("send_last_call_request" in request.POST and status_change.ad is not None):
form = LastCallTextForm(request.POST)
if form.is_valid():
events = []
Expand Down
25 changes: 16 additions & 9 deletions ietf/templates/doc/status_change/last_call.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,29 @@ <h1>
<br>
<small class="text-muted">{{ doc }}</small>
</h1>
{% if doc.ad is None %}
<div class="alert alert-warning my-3">
A responsible AD must be set before last call can be requested.
</div>
{% endif %}
<form class="my-3 edit-last-call-text" method="post">
{% csrf_token %}
{% bootstrap_form last_call_form %}
<button type="submit"
class="btn btn-primary"
name="save_last_call_text"
value="Save Last Call Text">Save text</button>
<button type="submit"
class="btn btn-warning"
name="send_last_call_request"
value="Save and Request Last Call">
Save text &amp; request last call
</button>
{% if user|has_role:"Secretariat" %}
<a class="btn btn-warning"
href="{% url 'ietf.doc.views_ballot.make_last_call' name=doc.name %}">Issue last call</a>
{% if doc.ad is not None %}
<button type="submit"
class="btn btn-warning"
name="send_last_call_request"
value="Save and Request Last Call">
Save text &amp; request last call
</button>
{% if user|has_role:"Secretariat" %}
<a class="btn btn-warning"
href="{% url 'ietf.doc.views_ballot.make_last_call' name=doc.name %}">Issue last call</a>
{% endif %}
{% endif %}
<button type="submit"
class="btn btn-danger"
Expand Down