@@ -207,12 +207,12 @@ def run():
207
207
208
208
# Handle status
209
209
# Check if status is in needs_statuses. If not raise an error.
210
- if config .needs_statuses :
211
- if status not in [ stat [ "name" ] for stat in config . needs_statuses ] :
212
- raise NeedsStatusNotAllowed (
213
- "Status {0} of need id {1} is not allowed "
214
- "by config value 'needs_statuses'." .format (status , need_id )
215
- )
210
+ allowed_status_names = ( s [ "name" ] for s in config .needs_statuses )
211
+ if config . needs_statuses and status not in allowed_status_names :
212
+ raise NeedsStatusNotAllowed (
213
+ "Status {0} of need id {1} is not allowed "
214
+ "by config value 'needs_statuses'." .format (status , need_id )
215
+ )
216
216
217
217
allowed_tags : Optional [List [str ]] = None
218
218
if config .needs_tags :
@@ -307,11 +307,13 @@ def run():
307
307
link_type ["option" ] not in list (kwargs .keys ())
308
308
or len (str (kwargs [link_type ["option" ]])) == 0
309
309
):
310
- # If it is in global option, value got already set during prior handling of them
310
+ # If it is in global option, value got already set during prior handling of
311
+ # them
311
312
links_string = needs_info [link_type ["option" ]]
312
313
links = utils .read_in_links (links_string )
313
314
else :
314
- # if it is set in kwargs, take this value and maybe override set value from global_options
315
+ # if it is set in kwargs, take this value and maybe override set value from
316
+ # global_options
315
317
links_string = kwargs [link_type ["option" ]]
316
318
links = utils .read_in_links (links_string )
317
319
0 commit comments