Fix error not appearing when updating to existing username (#6255)
Этот коммит содержится в:
коммит произвёл
Christopher Speller
родитель
1b82d98cdb
Коммит
514f038f44
@@ -183,9 +183,9 @@ func (us SqlUserStore) Update(user *model.User, trustedUpdateData bool) StoreCha
|
||||
|
||||
if count, err := us.GetMaster().Update(user); err != nil {
|
||||
if IsUniqueConstraintError(err.Error(), []string{"Email", "users_email_key", "idx_users_email_unique"}) {
|
||||
result.Err = model.NewLocAppError("SqlUserStore.Update", "store.sql_user.update.email_taken.app_error", nil, "user_id="+user.Id+", "+err.Error())
|
||||
result.Err = model.NewAppError("SqlUserStore.Update", "store.sql_user.update.email_taken.app_error", nil, "user_id="+user.Id+", "+err.Error(), http.StatusBadRequest)
|
||||
} else if IsUniqueConstraintError(err.Error(), []string{"Username", "users_username_key", "idx_users_username_unique"}) {
|
||||
result.Err = model.NewLocAppError("SqlUserStore.Update", "store.sql_user.update.username_taken.app_error", nil, "user_id="+user.Id+", "+err.Error())
|
||||
result.Err = model.NewAppError("SqlUserStore.Update", "store.sql_user.update.username_taken.app_error", nil, "user_id="+user.Id+", "+err.Error(), http.StatusBadRequest)
|
||||
} else {
|
||||
result.Err = model.NewLocAppError("SqlUserStore.Update", "store.sql_user.update.updating.app_error", nil, "user_id="+user.Id+", "+err.Error())
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user