Files
gitea/routers/web/admin/orgs.go
T
silverwind bef127f188 chore: update golangci-lint to v2.13.0
Migrate the deprecated gofumpt `extra-rules` to `extra.group-params`, as
the alias now also enables the new `clothe-returns` and `balance-calls`
rules. Disable SA4023, which hangs on go 1.27, see
https://github.com/golangci/golangci-lint/issues/6732.

Apply the resulting modernize fixes, mostly flattening embedded struct
literals and switching errors.As to errors.AsType.

Assisted-by: Claude:Opus 5
2026-08-20 06:21:34 +02:00

36 lines
1.1 KiB
Go

// Copyright 2014 The Gogs Authors. All rights reserved.
// Copyright 2020 The Gitea Authors.
// SPDX-License-Identifier: MIT
package admin
import (
"gitea.dev/models/db"
user_model "gitea.dev/models/user"
"gitea.dev/modules/setting"
"gitea.dev/modules/structs"
"gitea.dev/modules/templates"
"gitea.dev/routers/web/explore"
"gitea.dev/services/context"
)
const (
tplOrgs templates.TplName = "admin/org/list"
)
// Organizations show all the organizations
func Organizations(ctx *context.Context) {
ctx.Data["Title"] = ctx.Tr("admin.organizations")
ctx.Data["PageIsAdminOrganizations"] = true
sortOrder := ctx.FormString("sort", UserSearchDefaultAdminSort)
explore.RenderUserSearch(ctx, user_model.SearchUserOptions{
Actor: ctx.Doer,
Types: []user_model.UserType{user_model.UserTypeOrganization},
IncludeReserved: true, // administrator needs to list all accounts include reserved
PageSize: setting.UI.Admin.OrgPagingNum,
Visible: []structs.VisibleType{structs.VisibleTypePublic, structs.VisibleTypeLimited, structs.VisibleTypePrivate},
OrderBy: db.SearchOrderBy(sortOrder),
}, tplOrgs)
}