Skip to content

Commit a2bbf4c

Browse files
committed
fix comment and lint
1 parent 7f35e9c commit a2bbf4c

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

models/user.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1712,7 +1712,8 @@ func SearchUsers(opts *SearchUserOptions) (users []*User, _ int64, _ error) {
17121712
sessQuery = db.SetSessionPagination(sessQuery, opts)
17131713
}
17141714

1715-
sessQuery = sessQuery.Select("`user`.*")
1715+
// the sql may contain JOIN, so we must only select User related columns
1716+
sessQuery = sessQuery.Select("`user`.*")
17161717
users = make([]*User, 0, opts.PageSize)
17171718
return users, count, sessQuery.Find(&users)
17181719
}

modules/context/context.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -636,8 +636,9 @@ func Contexter() func(next http.Handler) http.Handler {
636636
"Link": link,
637637
},
638638
}
639+
// PageData is passed by reference, and it will be rendered to `window.config.PageData` in `head.tmpl` for JavaScript modules
639640
ctx.PageData = map[string]interface{}{}
640-
ctx.Data["PageData"] = ctx.PageData // by reference
641+
ctx.Data["PageData"] = ctx.PageData
641642

642643
ctx.Req = WithContext(req, &ctx)
643644
ctx.csrf = Csrfer(csrfOpts, &ctx)

0 commit comments

Comments
 (0)