Allow IRTF chair to adopt a draft into any RG.

Fixes #1082.
Commit ready for merge.
 - Legacy-Id: 8143
This commit is contained in:
Timothy B. Terriberry 2014-07-19 21:15:47 +00:00
parent dac3efcb68
commit e9c79a9e19
2 changed files with 10 additions and 0 deletions

View file

@ -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"),

View file

@ -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()