mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-28 06:33:50 +03:00
[MODERATION] User blocking (squash) RemoveUsernameParameterSuffix
This commit is contained in:
parent
8d3fab8944
commit
ee5a3a6401
1 changed files with 1 additions and 2 deletions
|
@ -11,7 +11,6 @@ import (
|
||||||
"code.gitea.io/gitea/models/db"
|
"code.gitea.io/gitea/models/db"
|
||||||
user_model "code.gitea.io/gitea/models/user"
|
user_model "code.gitea.io/gitea/models/user"
|
||||||
"code.gitea.io/gitea/modules/context"
|
"code.gitea.io/gitea/modules/context"
|
||||||
"code.gitea.io/gitea/routers/utils"
|
|
||||||
user_service "code.gitea.io/gitea/services/user"
|
user_service "code.gitea.io/gitea/services/user"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -35,7 +34,7 @@ func BlockedUsers(ctx *context.Context) {
|
||||||
|
|
||||||
// BlockedUsersBlock blocks a particular user from the organization.
|
// BlockedUsersBlock blocks a particular user from the organization.
|
||||||
func BlockedUsersBlock(ctx *context.Context) {
|
func BlockedUsersBlock(ctx *context.Context) {
|
||||||
uname := utils.RemoveUsernameParameterSuffix(strings.ToLower(ctx.FormString("uname")))
|
uname := strings.ToLower(ctx.FormString("uname"))
|
||||||
u, err := user_model.GetUserByName(ctx, uname)
|
u, err := user_model.GetUserByName(ctx, uname)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ctx.ServerError("GetUserByName", err)
|
ctx.ServerError("GetUserByName", err)
|
||||||
|
|
Loading…
Reference in a new issue