Merge pull request #149 from rgarmsen2295/mm-1260
MM-1260 Member Invites can no longer be sent to emails already used to signup
Этот коммит содержится в:
@@ -456,6 +456,15 @@ func inviteMembers(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
user = result.Data.(*model.User)
|
||||
}
|
||||
|
||||
var invNum int64 = 0
|
||||
for i, invite := range invites.Invites {
|
||||
if result := <-Srv.Store.User().GetByEmail(c.Session.TeamId, invite["email"]); result.Err == nil || result.Err.Message != "We couldn't find the existing account" {
|
||||
invNum = int64(i)
|
||||
c.Err = model.NewAppError("invite_members", "This person is already on your team", strconv.FormatInt(invNum, 10))
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
ia := make([]string, len(invites.Invites))
|
||||
for _, invite := range invites.Invites {
|
||||
ia = append(ia, invite["email"])
|
||||
|
||||
Ссылка в новой задаче
Block a user