Skip to content

Commit

Permalink
feat: continue running on user missing in create-teams (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
wznmickey authored Jul 23, 2024
1 parent 0ed098f commit bace3c0
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions joint_teapot/workers/gitea.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,12 @@ def create_teams_and_repos_by_canvas_groups(
},
)
logger.info(f"Team {team_name} created")
self.organization_api.org_add_team_repository(
team.id, self.org_name, repo_name
)
try:
self.organization_api.org_add_team_repository(
team.id, self.org_name, repo_name
)
except Exception as e:
logger.warning(e)
membership: GroupMembership
student_count = 0
for membership in group.get_memberships():
Expand All @@ -213,10 +216,14 @@ def create_teams_and_repos_by_canvas_groups(
except Exception as e:
logger.warning(e)
continue
self.organization_api.org_add_team_member(team.id, username)
self.repository_api.repo_add_collaborator(
self.org_name, repo_name, username
)
try:
self.organization_api.org_add_team_member(team.id, username)
self.repository_api.repo_add_collaborator(
self.org_name, repo_name, username
)
except Exception as e:
logger.error(e)
continue
try:
self.repository_api.repo_delete_branch_protection(
self.org_name, repo_name, "master"
Expand Down

0 comments on commit bace3c0

Please sign in to comment.