Show private heatmap on profile to self & admins (#14881)

followup to #14080
This commit is contained in:
Norwin 2021-03-04 22:59:13 +00:00 committed by GitHub
parent 11229ca539
commit 0a8a3ab0f5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 15 deletions

View file

@ -99,9 +99,7 @@ func Profile(ctx *context.Context) {
ctx.Data["Owner"] = ctxUser
ctx.Data["OpenIDs"] = openIDs
// no heatmap access for admins; GetUserHeatmapDataByUser ignores the calling user
// so everyone would get the same empty heatmap
if setting.Service.EnableUserHeatmap && !ctxUser.KeepActivityPrivate {
if setting.Service.EnableUserHeatmap {
data, err := models.GetUserHeatmapDataByUser(ctxUser, ctx.User)
if err != nil {
ctx.ServerError("GetUserHeatmapDataByUser", err)