mirror of
				https://github.com/go-gitea/gitea
				synced 2025-11-04 05:18:25 +00:00 
			
		
		
		
	Display error when adding a user to a team twice (#4746)
This commit is contained in:
		@@ -1312,6 +1312,7 @@ teams.search_repo_placeholder = Search repository…
 | 
				
			|||||||
teams.add_team_repository = Add Team Repository
 | 
					teams.add_team_repository = Add Team Repository
 | 
				
			||||||
teams.remove_repo = Remove
 | 
					teams.remove_repo = Remove
 | 
				
			||||||
teams.add_nonexistent_repo = "The repository you're trying to add does not exist; please create it first."
 | 
					teams.add_nonexistent_repo = "The repository you're trying to add does not exist; please create it first."
 | 
				
			||||||
 | 
					teams.add_duplicate_users = User is already a team member.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[admin]
 | 
					[admin]
 | 
				
			||||||
dashboard = Dashboard
 | 
					dashboard = Dashboard
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -96,7 +96,12 @@ func TeamsAction(ctx *context.Context) {
 | 
				
			|||||||
			return
 | 
								return
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		err = ctx.Org.Team.AddMember(u.ID)
 | 
							if ctx.Org.Team.IsMember(u.ID) {
 | 
				
			||||||
 | 
								ctx.Flash.Error(ctx.Tr("org.teams.add_duplicate_users"))
 | 
				
			||||||
 | 
							} else {
 | 
				
			||||||
 | 
								err = ctx.Org.Team.AddMember(u.ID)
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		page = "team"
 | 
							page = "team"
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user