@@ -1208,7 +1208,7 @@ def request_publication(request, name):
12081208
12091209class AdoptDraftForm (forms .Form ):
12101210 group = forms .ModelChoiceField (queryset = Group .objects .filter (type__in = ["wg" , "rg" ], state = "active" ).order_by ("-type" , "acronym" ), required = True , empty_label = None )
1211- newstate = forms .ModelChoiceField (queryset = State .objects .filter (type__in = ['draft-stream-ietf' ,'draft-stream-irtf' ],slug__in = [ 'wg-cand' , 'c-adopt' , 'adopt-wg' , 'info' , 'wg-doc' , 'candidat' , 'active' ]), required = True ,label = "State" )
1211+ newstate = forms .ModelChoiceField (queryset = State .objects .filter (type__in = ['draft-stream-ietf' ,'draft-stream-irtf' ], used = True ). exclude ( slug__in = settings . GROUP_STATES_WITH_EXTRA_PROCESSING ), required = True , label = "State" )
12121212 comment = forms .CharField (widget = forms .Textarea , required = False , label = "Comment" , help_text = "Optional comment explaining the reasons for the adoption." , strip = False )
12131213 weeks = forms .IntegerField (required = False , label = "Expected weeks in adoption state" )
12141214
@@ -1218,16 +1218,16 @@ def __init__(self, *args, **kwargs):
12181218 super (AdoptDraftForm , self ).__init__ (* args , ** kwargs )
12191219
12201220 if has_role (user , "Secretariat" ):
1221- state_choices = State .objects .filter (type__in = ['draft-stream-ietf' ,'draft-stream-irtf' ],slug__in = [ 'wg-cand' , 'c-adopt' , 'adopt-wg' , 'info' , 'wg-doc' , 'candidat' , 'active' ] )
1221+ state_choices = State .objects .filter (type__in = ['draft-stream-ietf' ,'draft-stream-irtf' ], used = True ). exclude ( slug__in = settings . GROUP_STATES_WITH_EXTRA_PROCESSING )
12221222 elif has_role (user , "IRTF Chair" ):
12231223 #The IRTF chair can adopt a draft into any RG
12241224 group_ids = list (Group .objects .filter (type = "rg" , state = "active" ).values_list ('id' , flat = True ))
12251225 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 )))
12261226 self .fields ["group" ].queryset = self .fields ["group" ].queryset .filter (id__in = group_ids ).distinct ()
1227- state_choices = State .objects .filter (type__in = [ 'draft-stream-ietf' , 'draft-stream- irtf'], slug__in = [ 'wg-cand' , 'c-adopt' , 'adopt-wg' , 'info' , 'wg-doc' , 'candidat' , 'active' ] )
1227+ state_choices = State .objects .filter (type = 'draft-stream-irtf' , used = True ). exclude ( slug__in = settings . GROUP_STATES_WITH_EXTRA_PROCESSING )
12281228 else :
12291229 self .fields ["group" ].queryset = self .fields ["group" ].queryset .filter (role__person__user = user , role__name__in = ("chair" , "delegate" , "secr" )).distinct ()
1230- state_choices = State .objects .filter (type__in = [ 'draft-stream-ietf' ,'draft-stream-irtf' ], slug__in = [ 'wg-cand' , 'c-adopt' , 'adopt-wg' , 'info' , 'wg-doc' ] )
1230+ state_choices = State .objects .filter (type = 'draft-stream-ietf' , used = True ). exclude ( slug__in = settings . GROUP_STATES_WITH_EXTRA_PROCESSING )
12311231
12321232 self .fields ['group' ].choices = [(g .pk , '%s - %s' % (g .acronym , g .name )) for g in self .fields ["group" ].queryset ]
12331233 self .fields ['newstate' ].choices = [('' ,'-- Pick a state --' )]
0 commit comments