Skip to content

Commit 2b21cb3

Browse files
committed
inline translation keys
remove dead conditional check
1 parent 54cb733 commit 2b21cb3

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

routers/private/hook_proc_receive.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import (
88
"net/http"
99

1010
issues_model "code.gitea.io/gitea/models/issues"
11-
repo_model "code.gitea.io/gitea/models/repo"
1211
user_model "code.gitea.io/gitea/models/user"
1312
"code.gitea.io/gitea/modules/git"
1413
"code.gitea.io/gitea/modules/log"
@@ -28,15 +27,13 @@ func HookProcReceive(ctx *gitea_context.PrivateContext) {
2827

2928
results, err := agit.ProcReceive(ctx, ctx.Repo.Repository, ctx.Repo.GitRepo, opts)
3029
if err != nil {
31-
if repo_model.IsErrUserDoesNotHaveAccessToRepo(err) {
32-
ctx.Error(http.StatusBadRequest, "UserDoesNotHaveAccessToRepo", err.Error())
33-
} else if errors.Is(err, issues_model.ErrMustCollaborator) {
30+
if errors.Is(err, issues_model.ErrMustCollaborator) {
3431
ctx.JSON(http.StatusUnauthorized, private.Response{
35-
Err: err.Error(), UserMsg: string(ctx.Tr("repo.pulls.new.must_collaborator")),
32+
Err: err.Error(), UserMsg: "You must be a collaborator to create pull request.",
3633
})
3734
} else if errors.Is(err, user_model.ErrBlockedUser) {
3835
ctx.JSON(http.StatusUnauthorized, private.Response{
39-
Err: err.Error(), UserMsg: string(ctx.Tr("repo.pulls.new.blocked_user")),
36+
Err: err.Error(), UserMsg: "Cannot create pull request because you are blocked by the repository owner.",
4037
})
4138
} else {
4239
log.Error(err.Error())

0 commit comments

Comments
 (0)