Skip to content

Commit d09b47d

Browse files
committed
fix panic in tests
1 parent 9368cfc commit d09b47d

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

routers/user/profile.go

+1-11
Original file line numberDiff line numberDiff line change
@@ -235,17 +235,7 @@ func Profile(ctx *context.Context) {
235235
}
236236
}
237237

238-
var showEmail bool
239-
240-
if len(ctxUser.Email) > 0 && ctx.IsSigned && !ctxUser.KeepEmailPrivate {
241-
showEmail = true
242-
} else if ctx.IsSigned {
243-
// Show email if the authenticated user owns the profile
244-
// being viewed
245-
showEmail = ctxUser.ID == ctx.User.ID
246-
}
247-
248-
ctx.Data["ShowUserEmail"] = showEmail
238+
ctx.Data["ShowUserEmail"] = len(ctxUser.Email) > 0 && ctx.IsSigned && (!ctxUser.KeepEmailPrivate || ctxUser.ID == ctx.User.ID)
249239

250240
ctx.HTML(200, tplProfile)
251241
}

0 commit comments

Comments
 (0)