mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2026-04-17 20:20:20 +00:00
chore: modernize code (#12065)
Followup of !11115, it was not checked against the the modernizer linter. Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/12065 Reviewed-by: Otto <otto@codeberg.org> Co-authored-by: Gusted <postmaster@gusted.xyz> Co-committed-by: Gusted <postmaster@gusted.xyz>
This commit is contained in:
parent
e16dc2ebfd
commit
6a5dda7116
3 changed files with 4 additions and 13 deletions
|
|
@ -20,10 +20,7 @@ const (
|
|||
|
||||
func FederationHost(ctx *context.Context) {
|
||||
federationHostID := ctx.ParamsInt64("id")
|
||||
page := ctx.FormInt("page")
|
||||
if page < 1 {
|
||||
page = 1
|
||||
}
|
||||
page := max(ctx.FormInt("page"), 1)
|
||||
|
||||
host, err := forgefed.GetFederationHost(ctx, federationHostID)
|
||||
if err != nil {
|
||||
|
|
@ -33,7 +30,7 @@ func FederationHost(ctx *context.Context) {
|
|||
|
||||
users, err := user_model.FindFederatedUsersByHostID(ctx, federationHostID, db.ListOptions{
|
||||
PageSize: setting.UI.Admin.FederationUserPagingNum,
|
||||
Page: int(page),
|
||||
Page: page,
|
||||
})
|
||||
if err != nil {
|
||||
ctx.ServerError("FindFederatedUsersByHostID", err)
|
||||
|
|
|
|||
|
|
@ -19,10 +19,7 @@ const (
|
|||
|
||||
func FederationHosts(ctx *context.Context) {
|
||||
sort := ctx.FormTrim("sort")
|
||||
page := ctx.FormInt("page")
|
||||
if page < 1 {
|
||||
page = 1
|
||||
}
|
||||
page := max(ctx.FormInt("page"), 1)
|
||||
|
||||
hosts, err := forgefed.FindFederationHosts(ctx, db.ListOptions{
|
||||
Page: page,
|
||||
|
|
|
|||
|
|
@ -18,10 +18,7 @@ const (
|
|||
)
|
||||
|
||||
func FederationUsers(ctx *context.Context) {
|
||||
page := ctx.FormInt("page")
|
||||
if page < 1 {
|
||||
page = 1
|
||||
}
|
||||
page := max(ctx.FormInt("page"), 1)
|
||||
|
||||
users, err := user_model.FindFederatedUsers(ctx, db.ListOptions{
|
||||
Page: page,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue