Fix incorrect user location link on profile page (#29474)

Fix #29472. Regression of #29236, a "if" check was missing.

(cherry picked from commit 10cfa0879a538a470598281d7093de3555c018be)
This commit is contained in:
wxiaoguang 2024-02-29 00:03:06 +08:00 committed by Earl Warren
parent 2b23f4bdee
commit 9c5afa0b8f
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00

View file

@ -36,8 +36,9 @@ func PrepareContextForProfileBigAvatar(ctx *context.Context) {
ctx.Data["IsBlocked"] = ctx.Doer != nil && user_model.IsBlocked(ctx, ctx.Doer.ID, ctx.ContextUser.ID)
ctx.Data["ShowUserEmail"] = setting.UI.ShowUserEmail && ctx.ContextUser.Email != "" && ctx.IsSigned && !ctx.ContextUser.KeepEmailPrivate
if setting.Service.UserLocationMapURL != "" {
ctx.Data["ContextUserLocationMapURL"] = setting.Service.UserLocationMapURL + url.QueryEscape(ctx.ContextUser.Location)
}
// Show OpenID URIs
openIDs, err := user_model.GetUserOpenIDs(ctx, ctx.ContextUser.ID)
if err != nil {