File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -1312,6 +1312,7 @@ teams.search_repo_placeholder = Search repository…
13121312teams.add_team_repository = Add Team Repository
13131313teams.remove_repo = Remove
13141314teams.add_nonexistent_repo = "The repository you' re trying to add does not exist; please create it first."
1315+ teams.add_duplicate_users = User is already a team member.
13151316
13161317[admin]
13171318dashboard = Dashboard
Original file line number Diff line number Diff line change @@ -96,7 +96,12 @@ func TeamsAction(ctx *context.Context) {
9696 return
9797 }
9898
99- err = ctx .Org .Team .AddMember (u .ID )
99+ if ctx .Org .Team .IsMember (u .ID ) {
100+ ctx .Flash .Error (ctx .Tr ("org.teams.add_duplicate_users" ))
101+ } else {
102+ err = ctx .Org .Team .AddMember (u .ID )
103+ }
104+
100105 page = "team"
101106 }
102107
You can’t perform that action at this time.
0 commit comments