0
0
Fork 0
mirror of https://github.com/go-gitea/gitea synced 2024-11-21 21:31:51 +01:00

Add missed return after ctx.ServerError (#31130) (#31133)

Backport #31130 by @lunny

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
Giteabot 2024-05-28 18:47:11 +08:00 committed by GitHub
parent d6ae2b3c4e
commit e6bacf1fed
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 5 additions and 0 deletions

View file

@ -383,6 +383,7 @@ func CreatePushMirror(ctx *context.APIContext, mirrorOption *api.CreatePushMirro
if err = mirror_service.AddPushMirrorRemote(ctx, pushMirror, address); err != nil {
if err := repo_model.DeletePushMirrors(ctx, repo_model.PushMirrorOptions{ID: pushMirror.ID, RepoID: pushMirror.RepoID}); err != nil {
ctx.ServerError("DeletePushMirrors", err)
return
}
ctx.ServerError("AddPushMirrorRemote", err)
return

View file

@ -95,6 +95,7 @@ func UnadoptedRepos(ctx *context.Context) {
repoNames, count, err := repo_service.ListUnadoptedRepositories(ctx, q, &opts)
if err != nil {
ctx.ServerError("ListUnadoptedRepositories", err)
return
}
ctx.Data["Dirs"] = repoNames
pager := context.NewPagination(count, opts.PageSize, opts.Page, 5)

View file

@ -831,6 +831,7 @@ func ActivateEmail(ctx *context.Context) {
if email := user_model.VerifyActiveEmailCode(ctx, code, emailStr); email != nil {
if err := user_model.ActivateEmail(ctx, email); err != nil {
ctx.ServerError("ActivateEmail", err)
return
}
log.Trace("Email activated: %s", email.Email)

View file

@ -571,6 +571,7 @@ func MoveIssues(ctx *context.Context) {
form := &movedIssuesForm{}
if err = json.NewDecoder(ctx.Req.Body).Decode(&form); err != nil {
ctx.ServerError("DecodeMovedIssuesForm", err)
return
}
issueIDs := make([]int64, 0, len(form.Issues))

View file

@ -562,6 +562,7 @@ func DeleteFilePost(ctx *context.Context) {
} else {
ctx.ServerError("DeleteRepoFile", err)
}
return
}
ctx.Flash.Success(ctx.Tr("repo.editor.file_delete_success", ctx.Repo.TreePath))