From 07382a07a4ad5b2f2357bc5ac243be03cd4dcb6e Mon Sep 17 00:00:00 2001 From: Ole Laursen Date: Fri, 4 May 2012 17:46:35 +0000 Subject: [PATCH] Add an entry to the group history when closing a group is being requested and use that to put a notice on the WG page. - Legacy-Id: 4399 --- ietf/group/models.py | 1 + ietf/templates/wginfo/wg_charterREDESIGN.html | 9 ++++++++- ietf/wginfo/edit.py | 5 +++++ ietf/wginfo/views.py | 8 +++++++- 4 files changed, 21 insertions(+), 2 deletions(-) diff --git a/ietf/group/models.py b/ietf/group/models.py index 5b8c62ca8..3aea02027 100644 --- a/ietf/group/models.py +++ b/ietf/group/models.py @@ -86,6 +86,7 @@ GROUP_EVENT_CHOICES = [ ("changed_state", "Changed state"), ("added_comment", "Added comment"), ("info_changed", "Changed metadata"), + ("requested_close", "Requested closing group"), ] class GroupEvent(models.Model): diff --git a/ietf/templates/wginfo/wg_charterREDESIGN.html b/ietf/templates/wginfo/wg_charterREDESIGN.html index 60f87e077..d5bd94391 100644 --- a/ietf/templates/wginfo/wg_charterREDESIGN.html +++ b/ietf/templates/wginfo/wg_charterREDESIGN.html @@ -55,7 +55,14 @@ is occasionally incorrect. Area:{{ wg.parent.name }} ({{ wg.parent.acronym }}) {% endif %} - State:{{ wg.state.name }} + + State: + {{ wg.state.name }} + {% if requested_close %} + (but in the process of being closed) + {% endif %} + + Charter: diff --git a/ietf/wginfo/edit.py b/ietf/wginfo/edit.py index 990e6fb56..ac7f56ccc 100644 --- a/ietf/wginfo/edit.py +++ b/ietf/wginfo/edit.py @@ -251,6 +251,11 @@ def conclude(request, acronym): email_secretariat(request, wg, "conclude", instructions) + e = GroupEvent(group=wg, by=login) + e.type = "requested_close" + e.desc = "Requested closing group" + e.save() + return redirect('wg_charter', acronym=wg.acronym) else: form = ConcludeForm() diff --git a/ietf/wginfo/views.py b/ietf/wginfo/views.py index 082c327ed..d8d10a5b9 100644 --- a/ietf/wginfo/views.py +++ b/ietf/wginfo/views.py @@ -168,13 +168,19 @@ def wg_charter(request, acronym): if settings.USE_DB_REDESIGN_PROXY_CLASSES: fill_in_charter_info(wg) actions = [] + + e = wg.latest_event(type__in=("changed_state", "requested_close",)) + requested_close = wg.state_id != "conclude" and e and e.type == "requested_close" + if wg.state_id != "conclude": actions.append(("Edit WG", urlreverse("wg_edit", kwargs=dict(acronym=wg.acronym)))) actions.append(("Request closing WG", urlreverse("wg_conclude", kwargs=dict(acronym=wg.acronym)))) context = get_wg_menu_context(wg, "charter") context.update(dict( - actions=actions)) + actions=actions, + requested_close=requested_close, + )) return render_to_response('wginfo/wg_charterREDESIGN.html', context,