Skip to content

Commit

Permalink
Revert "feat: grant team lead maintainer permissions on team create (#…
Browse files Browse the repository at this point in the history
…595)"

This reverts commit 3ea85c2.
  • Loading branch information
no-or committed Nov 29, 2020
1 parent 3ea85c2 commit bdf7898
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
5 changes: 2 additions & 3 deletions app/controller/command/commands/team.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,13 +370,12 @@ def create_helper(self, param_list, user_id) -> ResponseTuple:
self.gh.add_team_member(command_user.github_username, team_id)
team.add_member(command_user.github_id)
if param_list["lead"] is not None:
msg += "added lead as a maintainer"
msg += "added lead"
lead_user = self.facade.retrieve(User, param_list["lead"])
team.add_team_lead(lead_user.github_id)
if not self.gh.has_team_member(lead_user.github_username,
team_id):
self.gh.add_team_maintainer(
lead_user.github_username, team_id)
self.gh.add_team_member(lead_user.github_username, team_id)
else:
team.add_team_lead(command_user.github_id)

Expand Down
7 changes: 0 additions & 7 deletions interface/github.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,10 +206,3 @@ def remove_team_member(self, username: str, team_id: str):
team = self.org.get_team(int(team_id))
to_be_removed_member = cast(NamedUser, self.github.get_user(username))
team.remove_membership(to_be_removed_member)

@handle_github_error
def add_team_maintainer(self, username: str, team_id: str):
"""Add maintainer with given username to team with id team_id."""
team = self.org.get_team(int(team_id))
to_be_maintainer = cast(NamedUser, self.github.get_user(username))
team.add_membership(to_be_maintainer, 'maintainer')

0 comments on commit bdf7898

Please sign in to comment.