Fix error message if user not exist (#16343)

Co-authored-by: Sergey Dryabzhinsky <sergey@rusoft.ru>
This commit is contained in:
6543 2021-07-05 22:58:47 +02:00 committed by GitHub
parent c65e49d72f
commit 7ff8e863a5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -17,7 +17,7 @@ func GetUserByParamsName(ctx *context.APIContext, name string) *models.User {
user, err := models.GetUserByName(username)
if err != nil {
if models.IsErrUserNotExist(err) {
if redirectUserID, err := models.LookupUserRedirect(username); err == nil {
if redirectUserID, err2 := models.LookupUserRedirect(username); err2 == nil {
context.RedirectToUser(ctx.Context, username, redirectUserID)
} else {
ctx.NotFound("GetUserByName", err)