]> source.dussan.org Git - gitea.git/commitdiff
fetch emails of currently displayed user on admin page (#26918)
authortechknowlogick <hello@techknowlogick.com>
Tue, 5 Sep 2023 17:56:21 +0000 (13:56 -0400)
committerGitHub <noreply@github.com>
Tue, 5 Sep 2023 17:56:21 +0000 (17:56 +0000)
Currently, this fetches the emails from the user viewing the page. This
PR changes it to show the emails from the user whose page it is.

routers/web/admin/users.go

index 61df49b85ba1dffac929e9078b49edfcd2e9f336..c83d652c3d6a0f6ba61a04779a2d96f99b0a5871 100644 (file)
@@ -281,7 +281,7 @@ func ViewUser(ctx *context.Context) {
        ctx.Data["Repos"] = repos
        ctx.Data["ReposTotal"] = int(count)
 
-       emails, err := user_model.GetEmailAddresses(ctx.Doer.ID)
+       emails, err := user_model.GetEmailAddresses(u.ID)
        if err != nil {
                ctx.ServerError("GetEmailAddresses", err)
                return