File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -294,7 +294,18 @@ def create_missing_teams(self, dry: bool = False):
294294 for team , attributes in self .configured_teams .items ():
295295 if team not in existent_team_names :
296296 if parent := attributes .get ("parent" ): # type: ignore
297- parent_id = self .org .get_team_by_slug (sluggify_teamname (parent )).id
297+ try :
298+ parent_id = self .org .get_team_by_slug (sluggify_teamname (parent )).id
299+ except UnknownObjectException :
300+ if dry :
301+ logging .debug (
302+ "For team %s, the configured parent team's ('%s') ID wasn't found, "
303+ "probably because it should be created but it's a dry-run. "
304+ "We set a default ID of 424242" ,
305+ team ,
306+ parent ,
307+ )
308+ parent_id = 424242
298309
299310 logging .info ("Creating team '%s' with parent ID '%s'" , team , parent_id )
300311 self .stats .create_team (team )
You can’t perform that action at this time.
0 commit comments