forked from forgejo/forgejo
[MODERATION] add user blocking API
- Follow up for: #540, #802
- Add API routes for user blocking from user and organization
perspective.
- The new routes have integration testing.
- The new model functions have unit tests.
- Actually quite boring to write and to read this pull request.
(cherry picked from commit f3afaf15c7
)
This commit is contained in:
parent
37b4e6ef9b
commit
6d754db3e5
12 changed files with 626 additions and 9 deletions
|
@ -7,6 +7,7 @@ import (
|
|||
"net/http"
|
||||
"strings"
|
||||
|
||||
"code.gitea.io/gitea/models/db"
|
||||
user_model "code.gitea.io/gitea/models/user"
|
||||
"code.gitea.io/gitea/modules/context"
|
||||
"code.gitea.io/gitea/routers/utils"
|
||||
|
@ -20,7 +21,7 @@ func BlockedUsers(ctx *context.Context) {
|
|||
ctx.Data["Title"] = ctx.Tr("settings.blocked_users")
|
||||
ctx.Data["PageIsSettingsBlockedUsers"] = true
|
||||
|
||||
blockedUsers, err := user_model.ListBlockedUsers(ctx, ctx.Org.Organization.ID)
|
||||
blockedUsers, err := user_model.ListBlockedUsers(ctx, ctx.Org.Organization.ID, db.ListOptions{})
|
||||
if err != nil {
|
||||
ctx.ServerError("ListBlockedUsers", err)
|
||||
return
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue