Skip to content

Commit

Permalink
fix panic in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
adelowo committed Dec 9, 2018
1 parent 9368cfc commit d09b47d
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions routers/user/profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,17 +235,7 @@ func Profile(ctx *context.Context) {
}
}

var showEmail bool

if len(ctxUser.Email) > 0 && ctx.IsSigned && !ctxUser.KeepEmailPrivate {
showEmail = true
} else if ctx.IsSigned {
// Show email if the authenticated user owns the profile
// being viewed
showEmail = ctxUser.ID == ctx.User.ID
}

ctx.Data["ShowUserEmail"] = showEmail
ctx.Data["ShowUserEmail"] = len(ctxUser.Email) > 0 && ctx.IsSigned && (!ctxUser.KeepEmailPrivate || ctxUser.ID == ctx.User.ID)

ctx.HTML(200, tplProfile)
}
Expand Down

0 comments on commit d09b47d

Please sign in to comment.