Skip to content

Commit f52e676

Browse files
committed
Move chartering groups to /group/chartering/ (with a redirect from the old location), list RGs there too, and amend the previous fix to the chartering process for non-WGs so they have internal and external review states instead of just approved. Also move the code in wginfo/ to group/ as it is no longer just about info for WGs.
- Legacy-Id: 7556
1 parent a38a53e commit f52e676

49 files changed

Lines changed: 178 additions & 170 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

ietf/bin/send-milestone-reminders

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ os.environ.setdefault("DJANGO_SETTINGS_MODULE", "ietf.settings")
1111

1212
syslog.openlog(os.path.basename(__file__), syslog.LOG_PID, syslog.LOG_LOCAL0)
1313

14-
from ietf.wginfo.mails import *
14+
from ietf.group.mails import *
1515

1616
today = datetime.date.today()
1717

ietf/doc/views_charter.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
from ietf.utils.history import find_history_active_at
3131
from ietf.utils.mail import send_mail_preformatted
3232
from ietf.utils.textupload import get_cleaned_text_file_content
33-
from ietf.wginfo.mails import email_secretariat
33+
from ietf.group.mails import email_secretariat
3434

3535

3636
class ChangeStateForm(forms.Form):
@@ -46,7 +46,7 @@ def __init__(self, *args, **kwargs):
4646
if group.type_id == "wg":
4747
state_field.queryset = state_field.queryset.filter(slug__in=("infrev", "intrev", "extrev", "iesgrev"))
4848
else:
49-
state_field.queryset = state_field.queryset.filter(slug__in=("notrev", "approved"))
49+
state_field.queryset = state_field.queryset.filter(slug__in=("intrev", "extrev", "approved"))
5050
# hide requested fields
5151
if self.hide:
5252
for f in self.hide:
@@ -147,7 +147,7 @@ def change_state(request, name, option=None):
147147

148148
email_state_changed(request, charter, "State changed to %s." % charter_state)
149149

150-
if charter_state.slug == "intrev":
150+
if charter_state.slug == "intrev" and group.type_id == "wg":
151151
if request.POST.get("ballot_wo_extern"):
152152
create_ballot_if_not_open(charter, login, "r-wo-ext")
153153
else:
@@ -198,13 +198,15 @@ def change_state(request, name, option=None):
198198
def state_pk(slug):
199199
return State.objects.get(used=True, type="charter", slug=slug).pk
200200

201-
info_msg = {
202-
state_pk("infrev"): 'The %s "%s" (%s) has been set to Informal IESG review by %s.' % (group.type.name, group.name, group.acronym, login.plain_name()),
203-
state_pk("intrev"): 'The %s "%s" (%s) has been set to Internal review by %s.\nPlease place it on the next IESG telechat and inform the IAB.' % (group.type.name, group.name, group.acronym, login.plain_name()),
204-
state_pk("extrev"): 'The %s "%s" (%s) has been set to External review by %s.\nPlease send out the external review announcement to the appropriate lists.\n\nSend the announcement to other SDOs: Yes\nAdditional recipients of the announcement: ' % (group.type.name, group.name, group.acronym, login.plain_name()),
205-
}
201+
info_msg = {}
202+
if group.type_id == "wg":
203+
info_msg[state_pk("infrev")] = 'The %s "%s" (%s) has been set to Informal IESG review by %s.' % (group.type.name, group.name, group.acronym, login.plain_name())
204+
info_msg[state_pk("intrev")] = 'The %s "%s" (%s) has been set to Internal review by %s.\nPlease place it on the next IESG telechat and inform the IAB.' % (group.type.name, group.name, group.acronym, login.plain_name())
205+
info_msg[state_pk("extrev")] = 'The %s "%s" (%s) has been set to External review by %s.\nPlease send out the external review announcement to the appropriate lists.\n\nSend the announcement to other SDOs: Yes\nAdditional recipients of the announcement: ' % (group.type.name, group.name, group.acronym, login.plain_name())
206206

207-
states_for_ballot_wo_extern = State.objects.filter(used=True, type="charter", slug="intrev").values_list("pk", flat=True)
207+
states_for_ballot_wo_extern = State.objects.none()
208+
if group.type_id == "wg":
209+
states_for_ballot_wo_extern = State.objects.filter(used=True, type="charter", slug="intrev").values_list("pk", flat=True)
208210

209211
return render_to_response('doc/charter/change_state.html',
210212
dict(form=form,

ietf/feed_urls.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from django.views.generic import RedirectView
33

44
from ietf.doc.feeds import DocumentChangesFeed, InLastCallFeed
5-
from ietf.wginfo.feeds import GroupChangesFeed
5+
from ietf.group.feeds import GroupChangesFeed
66
from ietf.iesg.feeds import IESGAgendaFeed
77
from ietf.ipr.feeds import LatestIprDisclosuresFeed
88
from ietf.liaisons.feeds import LiaisonStatementsFeed
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
from ietf.ietfauth.utils import has_role
2323
from ietf.person.forms import EmailsField
2424
from ietf.person.models import Person, Email
25-
from ietf.wginfo.mails import email_secretariat
25+
from ietf.group.mails import email_secretariat
2626

2727
MAX_GROUP_DELEGATES = 3
2828

@@ -170,7 +170,7 @@ def submit_initial_charter(request, group_type, acronym=None):
170170
return redirect('charter_submit', name=group.charter.name, option="initcharter")
171171

172172
@login_required
173-
def edit(request, group_type, acronym=None, action="edit"):
173+
def edit(request, group_type=None, acronym=None, action="edit"):
174174
"""Edit or create a group, notifying parties as
175175
necessary and logging changes as group events."""
176176
if not can_manage_group_type(request.user, group_type):
@@ -314,7 +314,7 @@ def diff(attr, name):
314314
)
315315
form = GroupForm(initial=init, group=group, group_type=group_type)
316316

317-
return render(request, 'wginfo/edit.html',
317+
return render(request, 'group/edit.html',
318318
dict(group=group,
319319
form=form,
320320
action=action))
@@ -348,7 +348,7 @@ def conclude(request, group_type, acronym):
348348
else:
349349
form = ConcludeForm()
350350

351-
return render(request, 'wginfo/conclude.html',
351+
return render(request, 'group/conclude.html',
352352
dict(form=form, group=group))
353353

354354

@@ -382,7 +382,7 @@ def customize_workflow(request, group_type, acronym):
382382

383383
# redirect so the back button works correctly, otherwise
384384
# repeated POSTs fills up the history
385-
return redirect("ietf.wginfo.edit.customize_workflow", group_type=group.type_id, acronym=group.acronym)
385+
return redirect("ietf.group.edit.customize_workflow", group_type=group.type_id, acronym=group.acronym)
386386

387387
if action == "setnextstates":
388388
try:
@@ -399,7 +399,7 @@ def customize_workflow(request, group_type, acronym):
399399
transitions, _ = GroupStateTransitions.objects.get_or_create(group=group, state=state)
400400
transitions.next_states = next_states
401401

402-
return redirect("ietf.wginfo.edit.customize_workflow", group_type=group.type_id, acronym=group.acronym)
402+
return redirect("ietf.group.edit.customize_workflow", group_type=group.type_id, acronym=group.acronym)
403403

404404
if action == "settagactive":
405405
active = request.POST.get("active") == "1"
@@ -413,7 +413,7 @@ def customize_workflow(request, group_type, acronym):
413413
else:
414414
group.unused_tags.add(tag)
415415

416-
return redirect("ietf.wginfo.edit.customize_workflow", group_type=group.type_id, acronym=group.acronym)
416+
return redirect("ietf.group.edit.customize_workflow", group_type=group.type_id, acronym=group.acronym)
417417

418418
# put some info for the template on tags and states
419419
unused_tags = group.unused_tags.all().values_list('slug', flat=True)
@@ -437,7 +437,7 @@ def customize_workflow(request, group_type, acronym):
437437
s.next_states_checkboxes = [(x in n, x in default_n, x) for x in states]
438438
s.used_next_states = [x for x in n if x.slug not in unused_states]
439439

440-
return render(request, 'wginfo/customize_workflow.html', {
440+
return render(request, 'group/customize_workflow.html', {
441441
'group': group,
442442
'states': states,
443443
'tags': tags,
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
class GroupChangesFeed(Feed):
1313
feed_type = Atom1Feed
14-
description_template = "wginfo/feed_item_description.html"
14+
description_template = "group/feed_item_description.html"
1515

1616
def get_object(self, request, acronym):
1717
return Group.objects.get(acronym=acronym)
Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
from ietf.doc.utils import get_chartering_type
5050
from ietf.doc.templatetags.ietf_filters import clean_whitespace
5151
from ietf.group.models import Group, Role
52+
from ietf.name.models import GroupTypeName
5253
from ietf.group.utils import get_charter_text, can_manage_group_type, milestone_reviewer_for_group_type
5354
from ietf.utils.pipe import pipe
5455

@@ -96,7 +97,7 @@ def wg_summary_area(request, group_type):
9697

9798
areas = [a for a in areas if a.groups]
9899

99-
return render(request, 'wginfo/1wg-summary.txt',
100+
return render(request, 'group/1wg-summary.txt',
100101
{ 'areas': areas },
101102
content_type='text/plain; charset=UTF-8')
102103

@@ -107,7 +108,7 @@ def wg_summary_acronym(request, group_type):
107108
groups = Group.objects.filter(type="wg", state="active").order_by("acronym").select_related("parent")
108109
for group in groups:
109110
group.chairs = sorted(roles(group, "chair"), key=extract_last_name)
110-
return render(request, 'wginfo/1wg-summary-by-acronym.txt',
111+
return render(request, 'group/1wg-summary-by-acronym.txt',
111112
{ 'areas': areas,
112113
'groups': groups },
113114
content_type='text/plain; charset=UTF-8')
@@ -122,7 +123,7 @@ def wg_charters(request, group_type):
122123
for group in area.groups:
123124
fill_in_charter_info(group, include_drafts=True)
124125
group.area = area
125-
return render(request, 'wginfo/1wg-charters.txt',
126+
return render(request, 'group/1wg-charters.txt',
126127
{ 'areas': areas },
127128
content_type='text/plain; charset=UTF-8')
128129

@@ -138,7 +139,7 @@ def wg_charters_by_acronym(request, group_type):
138139
for group in groups:
139140
fill_in_charter_info(group, include_drafts=True)
140141
group.area = areas.get(group.parent_id)
141-
return render(request, 'wginfo/1wg-charters-by-acronym.txt',
142+
return render(request, 'group/1wg-charters-by-acronym.txt',
142143
{ 'groups': groups },
143144
content_type='text/plain; charset=UTF-8')
144145

@@ -162,7 +163,7 @@ def active_wgs(request):
162163
for group in area.groups:
163164
group.chairs = sorted(roles(group, "chair"), key=extract_last_name)
164165

165-
return render(request, 'wginfo/active_wgs.html', { 'areas':areas })
166+
return render(request, 'group/active_wgs.html', { 'areas':areas })
166167

167168
def active_rgs(request):
168169
irtf = Group.objects.get(acronym="irtf")
@@ -172,25 +173,27 @@ def active_rgs(request):
172173
for group in groups:
173174
group.chairs = sorted(roles(group, "chair"), key=extract_last_name)
174175

175-
return render(request, 'wginfo/active_rgs.html', { 'irtf': irtf, 'groups': groups })
176+
return render(request, 'group/active_rgs.html', { 'irtf': irtf, 'groups': groups })
176177

177178
def bofs(request, group_type):
178179
groups = Group.objects.filter(type=group_type, state="bof")
179-
return render(request, 'wginfo/bofs.html',dict(groups=groups))
180-
181-
def chartering_groups(request, group_type):
182-
if group_type != "wg":
183-
raise Http404
180+
return render(request, 'group/bofs.html',dict(groups=groups))
184181

182+
def chartering_groups(request):
185183
charter_states = State.objects.filter(used=True, type="charter").exclude(slug__in=("approved", "notrev"))
186-
groups = Group.objects.filter(type=group_type, charter__states__in=charter_states).select_related("state", "charter")
187184

188-
for g in groups:
189-
g.chartering_type = get_chartering_type(g.charter)
185+
group_types = GroupTypeName.objects.filter(slug__in=("wg", "rg"))
186+
187+
for t in group_types:
188+
t.chartering_groups = Group.objects.filter(type=t, charter__states__in=charter_states).select_related("state", "charter")
189+
t.can_manage = can_manage_group_type(request.user, t)
190+
191+
for g in t.chartering_groups:
192+
g.chartering_type = get_chartering_type(g.charter)
190193

191-
return render(request, 'wginfo/chartering_groups.html',
194+
return render(request, 'group/chartering_groups.html',
192195
dict(charter_states=charter_states,
193-
groups=groups))
196+
group_types=group_types))
194197

195198

196199
def construct_group_menu_context(request, group, selected, others):
@@ -207,10 +210,10 @@ def construct_group_menu_context(request, group, selected, others):
207210
actions.append((u"Edit group", urlreverse("group_edit", kwargs=dict(group_type=group.type_id, acronym=group.acronym))))
208211

209212
if is_chair or can_manage:
210-
actions.append((u"Customize workflow", urlreverse("ietf.wginfo.edit.customize_workflow", kwargs=dict(group_type=group.type_id, acronym=group.acronym))))
213+
actions.append((u"Customize workflow", urlreverse("ietf.group.edit.customize_workflow", kwargs=dict(group_type=group.type_id, acronym=group.acronym))))
211214

212215
if group.state_id in ("active", "dormant") and can_manage:
213-
actions.append((u"Request closing group", urlreverse("ietf.wginfo.edit.conclude", kwargs=dict(group_type=group.type_id, acronym=group.acronym))))
216+
actions.append((u"Request closing group", urlreverse("ietf.group.edit.conclude", kwargs=dict(group_type=group.type_id, acronym=group.acronym))))
214217

215218
d = {
216219
"group": group,
@@ -260,7 +263,7 @@ def group_documents(request, group_type, acronym):
260263

261264
docs, meta, docs_related, meta_related = search_for_group_documents(group)
262265

263-
return render(request, 'wginfo/group_documents.html',
266+
return render(request, 'group/group_documents.html',
264267
construct_group_menu_context(request, group, "documents", {
265268
'docs': docs,
266269
'meta': meta,
@@ -309,7 +312,7 @@ def group_charter(request, group_type, acronym):
309312

310313
can_manage = can_manage_group_type(request.user, group.type_id)
311314

312-
return render(request, 'wginfo/group_charter.html',
315+
return render(request, 'group/group_charter.html',
313316
construct_group_menu_context(request, group, "charter", {
314317
"milestones_in_review": group.groupmilestone_set.filter(state="review"),
315318
"milestone_reviewer": milestone_reviewer_for_group_type(group_type),
@@ -324,7 +327,7 @@ def history(request, group_type, acronym):
324327

325328
events = group.groupevent_set.all().select_related('by').order_by('-time', '-id')
326329

327-
return render(request, 'wginfo/history.html',
330+
return render(request, 'group/history.html',
328331
construct_group_menu_context(request, group, "history", {
329332
"events": events,
330333
}))
@@ -443,7 +446,7 @@ def make_dot(group):
443446
node.nodename=nodename(node.name)
444447
node.styles = get_node_styles(node,group)
445448

446-
return render_to_string('wginfo/dot.txt',
449+
return render_to_string('group/dot.txt',
447450
dict( nodes=nodes, edges=edges )
448451
)
449452

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def email_secretariat(request, group, subject, text):
1919
text = strip_tags(text)
2020

2121
send_mail(request, to, None, full_subject,
22-
"wginfo/email_secretariat.txt",
22+
"group/email_secretariat.txt",
2323
dict(text=text,
2424
group=group,
2525
group_url=settings.IDTRACKER_BASE_URL + urlreverse('group_charter', kwargs=dict(group_type=group.type_id, acronym=group.acronym)),
@@ -89,7 +89,7 @@ def email_milestone_review_reminder(group, grace_period=7):
8989

9090
send_mail(None, to, None,
9191
subject,
92-
"wginfo/reminder_milestones_need_review.txt",
92+
"group/reminder_milestones_need_review.txt",
9393
dict(group=group,
9494
milestones=milestones,
9595
reviewer=milestone_reviewer_for_group_type(group.type_id),
@@ -116,7 +116,7 @@ def email_milestones_due(group, early_warning_days):
116116

117117
send_mail(None, to, None,
118118
subject,
119-
"wginfo/reminder_milestones_due.txt",
119+
"group/reminder_milestones_due.txt",
120120
dict(group=group,
121121
milestones=milestones,
122122
today=today,
@@ -143,7 +143,7 @@ def email_milestones_overdue(group):
143143

144144
send_mail(None, to, None,
145145
subject,
146-
"wginfo/reminder_milestones_overdue.txt",
146+
"group/reminder_milestones_overdue.txt",
147147
dict(group=group,
148148
milestones=milestones,
149149
url=settings.IDTRACKER_BASE_URL + urlreverse("group_charter", kwargs=dict(group_type=group.type_id, acronym=group.acronym))
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from ietf.group.models import Group, GroupMilestone, MilestoneGroupEvent
1515
from ietf.group.utils import save_milestone_in_history, can_manage_group_type, milestone_reviewer_for_group_type
1616
from ietf.name.models import GroupMilestoneStateName
17-
from ietf.wginfo.mails import email_milestones_changed
17+
from ietf.group.mails import email_milestones_changed
1818

1919
def json_doc_names(docs):
2020
return json.dumps([{"id": doc.pk, "name": doc.name } for doc in docs])
@@ -317,7 +317,7 @@ def save_milestone_form(f):
317317

318318
forms.sort(key=lambda f: f.milestone.due if f.milestone else datetime.date.max)
319319

320-
return render(request, 'wginfo/edit_milestones.html',
320+
return render(request, 'group/edit_milestones.html',
321321
dict(group=group,
322322
title=title,
323323
forms=forms,
@@ -379,7 +379,7 @@ def reset_charter_milestones(request, group_type, acronym):
379379

380380
return redirect('group_edit_charter_milestones', group_type=group.type_id, acronym=group.acronym)
381381

382-
return render(request, 'wginfo/reset_charter_milestones.html',
382+
return render(request, 'group/reset_charter_milestones.html',
383383
dict(group=group,
384384
charter_milestones=charter_milestones,
385385
current_milestones=current_milestones,

0 commit comments

Comments
 (0)