summaryrefslogtreecommitdiffstats
path: root/routers/org
diff options
context:
space:
mode:
authorLanre Adelowo <adelowomailbox@gmail.com>2018-08-19 19:49:19 +0100
committerLauris BH <lauris@nix.lv>2018-08-19 21:49:19 +0300
commita6cdda115d6fecabea9406c3dd630087be49f437 (patch)
treee8049142479e5c16a3923e03b1c70d997ad134f5 /routers/org
parentb1ad5734c69025a85e3ed618576fc0160de9ce22 (diff)
downloadgitea-a6cdda115d6fecabea9406c3dd630087be49f437.tar.gz
gitea-a6cdda115d6fecabea9406c3dd630087be49f437.zip
Display error when adding a user to a team twice (#4746)
Diffstat (limited to 'routers/org')
-rw-r--r--routers/org/teams.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/routers/org/teams.go b/routers/org/teams.go
index 87bfb8596a..da6d81938a 100644
--- a/routers/org/teams.go
+++ b/routers/org/teams.go
@@ -96,7 +96,12 @@ func TeamsAction(ctx *context.Context) {
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"
}