mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
bump to go 1.23 (#31855)
This commit is contained in:
@@ -766,7 +766,7 @@ func EditPullRequest(ctx *context.APIContext) {
|
||||
// update allow edits
|
||||
if form.AllowMaintainerEdit != nil {
|
||||
if err := pull_service.SetAllowEdits(ctx, ctx.Doer, pr, *form.AllowMaintainerEdit); err != nil {
|
||||
if errors.Is(pull_service.ErrUserHasNoPermissionForAction, err) {
|
||||
if errors.Is(err, pull_service.ErrUserHasNoPermissionForAction) {
|
||||
ctx.Error(http.StatusForbidden, "SetAllowEdits", fmt.Sprintf("SetAllowEdits: %s", err))
|
||||
return
|
||||
}
|
||||
|
@@ -1625,7 +1625,7 @@ func SetAllowEdits(ctx *context.Context) {
|
||||
}
|
||||
|
||||
if err := pull_service.SetAllowEdits(ctx, ctx.Doer, pr, form.AllowMaintainerEdit); err != nil {
|
||||
if errors.Is(pull_service.ErrUserHasNoPermissionForAction, err) {
|
||||
if errors.Is(err, pull_service.ErrUserHasNoPermissionForAction) {
|
||||
ctx.Error(http.StatusForbidden)
|
||||
return
|
||||
}
|
||||
|
@@ -8,6 +8,7 @@ import (
|
||||
"bytes"
|
||||
gocontext "context"
|
||||
"encoding/base64"
|
||||
"errors"
|
||||
"fmt"
|
||||
"html/template"
|
||||
"image"
|
||||
@@ -739,7 +740,7 @@ func checkHomeCodeViewable(ctx *context.Context) {
|
||||
}
|
||||
}
|
||||
|
||||
ctx.NotFound("Home", fmt.Errorf(ctx.Locale.TrString("units.error.no_unit_allowed_repo")))
|
||||
ctx.NotFound("Home", errors.New(ctx.Locale.TrString("units.error.no_unit_allowed_repo")))
|
||||
}
|
||||
|
||||
func checkCitationFile(ctx *context.Context, entry *git.TreeEntry) {
|
||||
|
@@ -730,7 +730,7 @@ func UsernameSubRoute(ctx *context.Context) {
|
||||
|
||||
// check view permissions
|
||||
if !user_model.IsUserVisibleToViewer(ctx, ctx.ContextUser, ctx.Doer) {
|
||||
ctx.NotFound("user", fmt.Errorf(ctx.ContextUser.Name))
|
||||
ctx.NotFound("user", fmt.Errorf("%s", ctx.ContextUser.Name))
|
||||
return false
|
||||
}
|
||||
return true
|
||||
|
@@ -54,7 +54,7 @@ func OwnerProfile(ctx *context.Context) {
|
||||
func userProfile(ctx *context.Context) {
|
||||
// check view permissions
|
||||
if !user_model.IsUserVisibleToViewer(ctx, ctx.ContextUser, ctx.Doer) {
|
||||
ctx.NotFound("user", fmt.Errorf(ctx.ContextUser.Name))
|
||||
ctx.NotFound("user", fmt.Errorf("%s", ctx.ContextUser.Name))
|
||||
return
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user