From 1905d25aee03d24f8eaa96f0ca9602d8304f8a67 Mon Sep 17 00:00:00 2001 From: Henrik Levkowetz Date: Sat, 17 Jun 2017 14:28:13 +0000 Subject: [PATCH] Made changes to the can_adopt_draft() logic, to make it possible for a chair of multiple groups to correct the mistake if adoption was made for the wrong group. - Legacy-Id: 13662 --- ietf/doc/utils.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/ietf/doc/utils.py b/ietf/doc/utils.py index a91372c8a..6b4d03589 100644 --- a/ietf/doc/utils.py +++ b/ietf/doc/utils.py @@ -106,12 +106,15 @@ def can_adopt_draft(user, doc): return (doc.stream_id in (None, "irtf") and doc.group.type_id == "individ") + roles = Role.objects.filter(name__in=("chair", "delegate", "secr"), + group__type__in=("wg", "rg"), + group__state="active", + person__user=user) + role_groups = [ r.group for r in roles ] + return (doc.stream_id in (None, "ietf", "irtf") - and doc.group.type_id == "individ" - and Role.objects.filter(name__in=("chair", "delegate", "secr"), - group__type__in=("wg", "rg"), - group__state="active", - person__user=user).exists()) + and (doc.group.type_id == "individ" or doc.group in role_groups) + and roles.exists()) def two_thirds_rule( recused=0 ): # For standards-track, need positions from 2/3 of the non-recused current IESG.