diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2022-06-13 17:37:59 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-13 17:37:59 +0800 |
commit | 1a9821f57a0293db3adc0eab8aff08ca5fa1026c (patch) | |
tree | 3c3d02813eb63c0d0827ef6d9745f6dcdd2636cb /services/pull/edits.go | |
parent | 3708ca8e2849ca7e36e6bd15ec6935a2a2d81e55 (diff) | |
download | gitea-1a9821f57a0293db3adc0eab8aff08ca5fa1026c.tar.gz gitea-1a9821f57a0293db3adc0eab8aff08ca5fa1026c.zip |
Move issues related files into models/issues (#19931)
* Move access and repo permission to models/perm/access
* fix test
* fix git test
* Move functions sequence
* Some improvements per @KN4CK3R and @delvh
* Move issues related code to models/issues
* Move some issues related sub package
* Merge
* Fix test
* Fix test
* Fix test
* Fix test
* Rename some files
Diffstat (limited to 'services/pull/edits.go')
-rw-r--r-- | services/pull/edits.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/services/pull/edits.go b/services/pull/edits.go index 11932d9ab8..2938f2b108 100644 --- a/services/pull/edits.go +++ b/services/pull/edits.go @@ -9,7 +9,7 @@ import ( "context" "errors" - "code.gitea.io/gitea/models" + issues_model "code.gitea.io/gitea/models/issues" access_model "code.gitea.io/gitea/models/perm/access" unit_model "code.gitea.io/gitea/models/unit" user_model "code.gitea.io/gitea/models/user" @@ -18,7 +18,7 @@ import ( var ErrUserHasNoPermissionForAction = errors.New("user not allowed to do this action") // SetAllowEdits allow edits from maintainers to PRs -func SetAllowEdits(ctx context.Context, doer *user_model.User, pr *models.PullRequest, allow bool) error { +func SetAllowEdits(ctx context.Context, doer *user_model.User, pr *issues_model.PullRequest, allow bool) error { if doer == nil || !pr.Issue.IsPoster(doer.ID) { return ErrUserHasNoPermissionForAction } @@ -37,5 +37,5 @@ func SetAllowEdits(ctx context.Context, doer *user_model.User, pr *models.PullRe } pr.AllowMaintainerEdit = allow - return models.UpdateAllowEdits(ctx, pr) + return issues_model.UpdateAllowEdits(ctx, pr) } |