[MM-34725] app/user: check if username or email is in use before patching a user (#17392)

* app/user: check if username or email is in use before patching a user

* reflect review comments

* fix tests
Этот коммит содержится в:
Ibrahim Serdar Acikgoz
2021-04-16 18:41:32 +03:00
коммит произвёл GitHub
родитель 3ea75332e7
Коммит 3a13987ee1
23 изменённых файлов: 57 добавлений и 85 удалений

Просмотреть файл

@@ -204,7 +204,7 @@ func TestPatchBot(t *testing.T) {
_, err = th.App.PatchBot(bot.UserId, botPatch)
require.NotNil(t, err)
require.Equal(t, "app.user.update.find.app_error", err.Id)
require.Equal(t, "app.user.save.username_exists.app_error", err.Id)
})
}