From e9c79a9e19325db2c62d25b652b31dc74cae97ef Mon Sep 17 00:00:00 2001 From: "Timothy B. Terriberry" Date: Sat, 19 Jul 2014 21:15:47 +0000 Subject: [PATCH] Allow IRTF chair to adopt a draft into any RG. Fixes #1082. Commit ready for merge. - Legacy-Id: 8143 --- ietf/doc/utils.py | 5 +++++ ietf/doc/views_draft.py | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/ietf/doc/utils.py b/ietf/doc/utils.py index 061466b05..6cd494b00 100644 --- a/ietf/doc/utils.py +++ b/ietf/doc/utils.py @@ -54,6 +54,11 @@ def can_adopt_draft(user, doc): if has_role(user, "Secretariat"): return True + #The IRTF chair can adopt a draft into any RG + if has_role(user, "IRTF Chair"): + return (doc.stream_id in (None, "irtf") + and doc.group.type_id == "individ") + return (doc.stream_id in (None, "ietf", "irtf") and doc.group.type_id == "individ" and Role.objects.filter(name__in=("chair", "delegate", "secr"), diff --git a/ietf/doc/views_draft.py b/ietf/doc/views_draft.py index bc47e441e..4f3ced01c 100644 --- a/ietf/doc/views_draft.py +++ b/ietf/doc/views_draft.py @@ -1276,6 +1276,11 @@ class AdoptDraftForm(forms.Form): if has_role(user, "Secretariat"): pass # all groups + elif has_role(user, "IRTF Chair"): + #The IRTF chair can adopt a draft into any RG + group_ids = list(Group.objects.filter(type="rg", state="active").values_list('id', flat=True)) + group_ids.extend(list(Group.objects.filter(type="wg", state="active", role__person__user=user, role__name__in=("chair", "delegate", "secr")).values_list('id', flat=True))) + self.fields["group"].queryset = self.fields["group"].queryset.filter(id__in=group_ids).distinct() else: self.fields["group"].queryset = self.fields["group"].queryset.filter(role__person__user=user, role__name__in=("chair", "delegate", "secr")).distinct()