Small tweaks and cleanup
Этот коммит содержится в:
@@ -457,12 +457,12 @@ func inviteMembers(c *Context, w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var invNum int64 = 0
|
var invNum int64 = 0
|
||||||
for _, invite := range invites.Invites {
|
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" {
|
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))
|
c.Err = model.NewAppError("invite_members", "This person is already on your team", strconv.FormatInt(invNum, 10))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
invNum++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ia := make([]string, len(invites.Invites))
|
ia := make([]string, len(invites.Invites))
|
||||||
|
|||||||
@@ -43,7 +43,6 @@ module.exports = React.createClass({
|
|||||||
var first_name_errors = this.state.first_name_errors;
|
var first_name_errors = this.state.first_name_errors;
|
||||||
var last_name_errors = this.state.last_name_errors;
|
var last_name_errors = this.state.last_name_errors;
|
||||||
var valid = true;
|
var valid = true;
|
||||||
var profiles = UserStore.getProfiles();
|
|
||||||
|
|
||||||
for (var i = 0; i < count; i++) {
|
for (var i = 0; i < count; i++) {
|
||||||
var index = invite_ids[i];
|
var index = invite_ids[i];
|
||||||
@@ -53,13 +52,6 @@ module.exports = React.createClass({
|
|||||||
email_errors[index] = "Please enter a valid email address";
|
email_errors[index] = "Please enter a valid email address";
|
||||||
valid = false;
|
valid = false;
|
||||||
} else {
|
} else {
|
||||||
for (var email in profiles) {
|
|
||||||
if (email === invite.email) {
|
|
||||||
email_errors[index] = "This person is already on your team";
|
|
||||||
valid = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
email_errors[index] = "";
|
email_errors[index] = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -151,8 +143,7 @@ module.exports = React.createClass({
|
|||||||
id_count: 0,
|
id_count: 0,
|
||||||
email_errors: {},
|
email_errors: {},
|
||||||
first_name_errors: {},
|
first_name_errors: {},
|
||||||
last_name_errors: {},
|
last_name_errors: {}
|
||||||
server_errors: {}
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
render: function() {
|
render: function() {
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user