From 7ff8e863a5a0a794444792e990a6a37886dbd2bb Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Mon, 5 Jul 2021 22:58:47 +0200 Subject: [PATCH] Fix error message if user not exist (#16343) Co-authored-by: Sergey Dryabzhinsky --- routers/api/v1/user/helper.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routers/api/v1/user/helper.go b/routers/api/v1/user/helper.go index fcdac257ed..a3500e0ee6 100644 --- a/routers/api/v1/user/helper.go +++ b/routers/api/v1/user/helper.go @@ -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) -- 2.39.5