Skip to content

Commit afe3ee7

Browse files
committed
Merged in fixes from Ole, from branch/charter:r4382-4407, and some changes from Henrik (removing the use of pos.blocked in views_ballot.py, and setting a ballot id in idrfc/testsREDESIGN.py) to make idrfc.EditPositionTestCase succeed.
- Legacy-Id: 4444
2 parents 4b326f8 + bb30e1d commit afe3ee7

18 files changed

Lines changed: 329 additions & 108 deletions

ietf/group/models.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ def __unicode__(self):
8686
("changed_state", "Changed state"),
8787
("added_comment", "Added comment"),
8888
("info_changed", "Changed metadata"),
89+
("requested_close", "Requested closing group"),
8990
]
9091

9192
class GroupEvent(models.Model):

ietf/idrfc/idrfc_wrapper.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
from ietf.idtracker.models import InternetDraft, IDInternal, BallotInfo, IESGDiscuss, IESGLogin, DocumentComment, Acronym, IDState
3434
from ietf.idrfc.models import RfcEditorQueue
3535
from ietf.ipr.models import IprRfc, IprDraft, IprDetail
36+
from ietf.doc.models import BallotDocEvent
3637

3738
import re
3839
from datetime import date

ietf/idrfc/testsREDESIGN.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
from django.conf import settings
4141

4242
from pyquery import PyQuery
43+
import debug
4344

4445
from ietf.doc.models import *
4546
from ietf.name.models import *
@@ -505,7 +506,8 @@ def test_edit_position_as_secretary(self):
505506

506507
def test_cannot_edit_position_as_pre_ad(self):
507508
draft = make_test_data()
508-
url = urlreverse('doc_edit_position', kwargs=dict(name=draft.name))
509+
url = urlreverse('doc_edit_position', kwargs=dict(name=draft.name,
510+
ballot_id=draft.latest_event(BallotDocEvent, type="created_ballot").pk))
509511

510512
# transform to pre-ad
511513
ad_role = Role.objects.filter(name="ad")[0]

ietf/idrfc/views_ballot.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
from django.utils import simplejson
1414
from django.conf import settings
1515

16+
import debug
17+
1618
from ietf.utils.mail import send_mail_text, send_mail_preformatted
1719
from ietf.ietfauth.decorators import group_required, role_required
1820
from ietf.idtracker.templatetags.ietf_filters import in_group
@@ -274,8 +276,10 @@ def edit_positionREDESIGN(request, name, ballot_id):
274276
pos.comment = clean["comment"].rstrip()
275277
pos.comment_time = old_pos.comment_time if old_pos else None
276278
pos.discuss = clean["discuss"].rstrip()
277-
if not pos.pos.blocking:
279+
if not pos.pos_id == "discuss":
278280
pos.discuss = ""
281+
# if not pos.pos.blocking:
282+
# pos.discuss = ""
279283
pos.discuss_time = old_pos.discuss_time if old_pos else None
280284

281285
changes = []
@@ -350,7 +354,6 @@ def edit_positionREDESIGN(request, name, ballot_id):
350354
form = EditPositionForm(initial=initial, ballot_type=ballot.ballot_type)
351355

352356
blocking_positions = dict((p.pk, p.name) for p in form.fields["position"].queryset.all() if p.blocking)
353-
print blocking_positions, form.fields["position"].queryset.all()
354357

355358
ballot_deferred = None
356359
if doc.get_state_slug("%s-iesg" % doc.type_id) == "defer":
@@ -363,7 +366,7 @@ def edit_positionREDESIGN(request, name, ballot_id):
363366
return_to_url=return_to_url,
364367
old_pos=old_pos,
365368
ballot_deferred=ballot_deferred,
366-
show_discuss_text=old_pos and old_pos.pos.blocking,
369+
show_discuss_text=old_pos and old_pos.pos_id=="discuss",
367370
blocking_positions=simplejson.dumps(blocking_positions),
368371
),
369372
context_instance=RequestContext(request))
@@ -476,7 +479,7 @@ def send_ballot_commentREDESIGN(request, name, ballot_id):
476479
subj = []
477480
d = ""
478481
blocking_name = "DISCUSS"
479-
if pos.pos.blocking and pos.discuss:
482+
if pos.pos_id == "discuss" and pos.discuss:
480483
d = pos.discuss
481484
blocking_name = pos.pos.name.upper()
482485
subj.append(blocking_name)

ietf/idrfc/views_search.py

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,14 @@ def clean_name(self):
6868
def clean(self):
6969
q = self.cleaned_data
7070
# Reset query['by'] if needed
71-
for k in ('author','group','area','ad'):
72-
if (q['by'] == k) and not q[k]:
71+
if 'by' not in q:
72+
q['by'] = None
73+
else:
74+
for k in ('author','group','area','ad'):
75+
if (q['by'] == k) and not q[k]:
76+
q['by'] = None
77+
if (q['by'] == 'state') and not (q['state'] or q['subState']):
7378
q['by'] = None
74-
if (q['by'] == 'state') and not (q['state'] or q['subState']):
75-
q['by'] = None
7679
# Reset other fields
7780
for k in ('author','group','area','ad'):
7881
if q['by'] != k:
@@ -296,11 +299,14 @@ def clean_name(self):
296299
def clean(self):
297300
q = self.cleaned_data
298301
# Reset query['by'] if needed
299-
for k in ('author','group','area','ad'):
300-
if (q['by'] == k) and (k not in q or not q[k]):
302+
if 'by' not in q:
303+
q['by'] = None
304+
else:
305+
for k in ('author','group','area','ad'):
306+
if (q['by'] == k) and (k not in q or not q[k]):
307+
q['by'] = None
308+
if (q['by'] == 'state') and (not 'state' in q or not 'subState' in q or not (q['state'] or q['subState'])):
301309
q['by'] = None
302-
if (q['by'] == 'state') and (not 'state' in q or not 'subState' in q or not (q['state'] or q['subState'])):
303-
q['by'] = None
304310
# Reset other fields
305311
for k in ('author','group','area','ad'):
306312
if q['by'] != k:

ietf/submit/tests.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
from ietf.person.models import Person, Email
1818
from ietf.group.models import Group, Role
19-
from ietf.doc.models import Document, BallotPositionDocEvent
19+
from ietf.doc.models import Document, BallotDocEvent, BallotPositionDocEvent
2020
from ietf.submit.models import IdSubmissionDetail
2121

2222
class SubmitTestCase(django.test.TestCase):
@@ -163,6 +163,7 @@ def test_submit_existing(self):
163163

164164
# make a discuss to see if the AD gets an email
165165
ballot_position = BallotPositionDocEvent()
166+
ballot_position.ballot = draft.latest_event(BallotDocEvent, type="created_ballot")
166167
ballot_position.pos_id = "discuss"
167168
ballot_position.type = "changed_ballot_position"
168169
ballot_position.doc = draft
@@ -234,7 +235,7 @@ def test_submit_existing(self):
234235
self.assertTrue(name in unicode(outbox[-2]))
235236
self.assertTrue("mars" in unicode(outbox[-2]))
236237
self.assertTrue(draft.ad.role_email("ad").address in unicode(outbox[-2]))
237-
self.assertTrue(ballot_position.ad.email_address() in unicode(outbox[-2]))
238+
self.assertTrue(ballot_position.ad.role_email("ad").address in unicode(outbox[-2]))
238239
self.assertTrue("New Version Notification" in outbox[-1]["Subject"])
239240
self.assertTrue(name in unicode(outbox[-1]))
240241
self.assertTrue("mars" in unicode(outbox[-1]))

ietf/templates/idrfc/document_charter.html

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@
5353

5454
{% else %}
5555
{% if group.state_id == "proposed" or group.state_id == "bof" %}
56-
- <a href="{% url charter_startstop_process name=doc.name option='initcharter' %}">Charter</a>
56+
- <a href="{% url charter_submit name=doc.name option='initcharter' %}">Start chartering</a>
5757
{% else %}
58-
- <a href="{% url charter_startstop_process name=doc.name option='recharter' %}">Recharter</a>
58+
- <a href="{% url charter_submit name=doc.name option='recharter' %}">Recharter</a>
5959
{% endif %}
6060
{% endif %}
6161

@@ -88,16 +88,24 @@
8888
</tr>
8989
{% endif %}
9090

91-
9291
<tr><td colspan='2'><hr size='1' noshade /></td></tr>
9392

93+
<tr>
94+
<td>Send notices to:</td>
95+
<td>{{ doc.notify|default:"none" }}
96+
{% if user|has_role:"Area Director,Secretariat" %}
97+
- <a href="{% url charter_edit_notify name=doc.name %}">Change</a>
98+
{% endif %}
99+
</td>
100+
</tr>
101+
94102
<tr><td>Last updated:</td><td> {{ doc.time|date:"Y-m-d" }}</td></tr>
95103

96104
<tr><td colspan='2'><hr size='1' noshade /></td></tr>
97105
</table>
98106

99107
<div class="actions">
100-
<a href="/feed/wgchanges/{{ group.acronym }}/">Atom feed</a>
108+
<a href="/feed/group-changes/{{ group.acronym }}/">Atom feed</a>
101109
</div>
102110
</div>
103111

ietf/templates/wgcharter/change_state.html

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@
2020
{% block content %}
2121
<h1>{{ title }}</h1>
2222

23-
{% if "Change state" in title %}<p class="helptext">For help on the states, see the <a href="{% url help_charter_states %}">state table</a>.</p>{% endif %}
23+
{% if not option %}
24+
<p class="helptext">For help on the states, see the <a href="{% url help_charter_states %}">state table</a>.</p>
25+
{% endif %}
2426

2527
<form class="change-state" action="" method="post">
2628
<table>
@@ -60,9 +62,10 @@ <h1>{{ title }}</h1>
6062
{% endif %}
6163
<tr>
6264
<td colspan="2" class="actions">
63-
{% if option %}
64-
<input type="submit" value="Submit"/>
65-
{% else %}
65+
{% if option == "initcharter" or option == "recharter" %}
66+
<input type="submit" value="Initiate chartering"/>
67+
{% endif %}
68+
{% if not option or option == "abandon" %}
6669
<a href="{% url doc_view name=doc.name %}">Back</a>
6770
<input type="submit" value="Save and (possibly) notify Secretariat"/>
6871
{% endif %}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{% extends "base.html" %}
2+
3+
{% block title %}Set notification list for {{ doc.name }}{% endblock %}
4+
5+
{% block morecss %}
6+
form.edit-notify td input#id_notify { width: 40em; }
7+
form.edit-notify td.actions { padding-top: 1em; }
8+
{% endblock %}
9+
10+
{% block content %}
11+
{% load ietf_filters %}
12+
<h1>Set notification list for {{ doc.name }}</h1>
13+
14+
<form class="edit-notify" action="" method="POST">
15+
<table>
16+
<tr>
17+
<th>{{ form.notify.label_tag }}:</th>
18+
<td>{{ form.notify }}
19+
<div class="help">{{ form.notify.help_text }}</div>
20+
{{ form.notify.errors }}
21+
</td>
22+
</tr>
23+
<tr>
24+
<td></td>
25+
<td class="actions">
26+
<a href="{% url doc_view name=doc.name %}">Back</a>
27+
<input type="submit" value="Save"/>
28+
</td>
29+
</tr>
30+
</table>
31+
</form>
32+
{% endblock %}

ietf/templates/wginfo/edit.html

Lines changed: 32 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -4,35 +4,20 @@
44
{% if wg %}
55
Edit WG {{ wg.acronym }}
66
{% else %}
7-
Create WG
7+
Start chartering new WG
88
{% endif %}
99
{% endblock %}
1010

1111
{% block morecss %}
12-
form.edit-info #id_name {
13-
width: 396px;
14-
}
15-
16-
form.edit-info #id_list_email {
17-
width: 396px;
18-
}
19-
20-
form.edit-info #id_list_subscribe {
21-
width: 396px;
22-
}
23-
24-
form.edit-info #id_list_archive {
25-
width: 396px;
26-
}
27-
28-
form.edit-info #id_urls {
29-
width: 400px;
30-
}
31-
32-
form.edit-info #id_comments {
33-
width: 400px;
34-
}
35-
12+
form.edit #id_name,
13+
form.edit #id_list_email,
14+
form.edit #id_list_subscribe,
15+
form.edit #id_list_archive,
16+
form.edit #id_urls,
17+
form.edit #id_comments { width: 400px; }
18+
form.edit input[type=checkbox] { vertical-align: middle; }
19+
ul.errorlist { border-width: 0px; padding: 0px; margin: 0px;}
20+
ul.errorlist li { color: #a00; margin: 0px; padding: 0px; list-style: none; }
3621
{% endblock %}
3722

3823
{% block pagehead %}
@@ -44,11 +29,11 @@
4429
<h1>{% if wg %}
4530
Edit WG {{ wg.acronym }}
4631
{% else %}
47-
Create WG
32+
Start chartering new WG
4833
{% endif %}
4934
</h1>
5035

51-
<form class="edit-info" action="" method="POST">
36+
<form class="edit" action="" method="POST">
5237
<table>
5338
{% for field in form.visible_fields %}
5439
<tr>
@@ -63,6 +48,14 @@ <h1>{% if wg %}
6348
{{ field.errors }}
6449
</td>
6550
</tr>
51+
{% if field.name == "acronym" and form.confirm_msg %}
52+
<tr>
53+
<td></td>
54+
<td><input name="confirmed" type="checkbox"{% if form.autoenable_confirm %} checked="checked"{% endif %}/>
55+
{{ form.confirm_msg }}
56+
</td>
57+
</tr>
58+
{% endif %}
6659
{% endfor %}
6760
<tr>
6861
<td></td>
@@ -71,7 +64,7 @@ <h1>{% if wg %}
7164
<a href="{% url wg_charter acronym=wg.acronym %}">Back</a>
7265
<input type="submit" value="Save"/>
7366
{% else %}
74-
<input type="submit" value="Create"/>
67+
<input type="submit" value="Start chartering"/>
7568
{% endif %}
7669
</td>
7770
</tr>
@@ -83,4 +76,15 @@ <h1>{% if wg %}
8376
<script type="text/javascript" src="/js/lib/jquery.tokeninput.js"></script>
8477
<script type="text/javascript" src="/js/lib/json2.js"></script>
8578
<script type="text/javascript" src="/js/emails-field.js"></script>
79+
<script>
80+
jQuery(function () {
81+
if (jQuery('input[name="confirmed"]').length > 0) {
82+
jQuery('input[name="acronym"]').change(function() {
83+
// make sure we don't accidentally confirm another acronym
84+
jQuery('input[name="confirmed"]').closest("tr").remove();
85+
jQuery('input[name="acronym"]').siblings(".errorlist").remove();
86+
});
87+
}
88+
});
89+
</script>
8690
{% endblock %}

0 commit comments

Comments
 (0)