Merged in [8143] from tterriberry@mozilla.com:\n Allow IRTF chair to adopt a draft into any RG.

Fixes .
 - Legacy-Id: 8153
Note: SVN reference [8143] has been migrated to Git commit e9c79a9e19
This commit is contained in:
Henrik Levkowetz 2014-07-20 15:04:12 +00:00
commit 712c89f149
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()