Move unit into models/unit/ (#17576)
* Move unit into models/unit/ * Rename unit.UnitType as unit.Type
This commit is contained in:
parent
b6b1e71665
commit
99b2858e62
68 changed files with 556 additions and 491 deletions
|
@ -6,6 +6,7 @@ package webhook
|
|||
|
||||
import (
|
||||
"code.gitea.io/gitea/models"
|
||||
"code.gitea.io/gitea/models/unit"
|
||||
"code.gitea.io/gitea/modules/convert"
|
||||
"code.gitea.io/gitea/modules/git"
|
||||
"code.gitea.io/gitea/modules/log"
|
||||
|
@ -136,7 +137,7 @@ func (m *webhookNotifier) NotifyMigrateRepository(doer *models.User, u *models.U
|
|||
|
||||
func (m *webhookNotifier) NotifyIssueChangeAssignee(doer *models.User, issue *models.Issue, assignee *models.User, removed bool, comment *models.Comment) {
|
||||
if issue.IsPull {
|
||||
mode, _ := models.AccessLevelUnit(doer, issue.Repo, models.UnitTypePullRequests)
|
||||
mode, _ := models.AccessLevelUnit(doer, issue.Repo, unit.TypePullRequests)
|
||||
|
||||
if err := issue.LoadPullRequest(); err != nil {
|
||||
log.Error("LoadPullRequest failed: %v", err)
|
||||
|
@ -160,7 +161,7 @@ func (m *webhookNotifier) NotifyIssueChangeAssignee(doer *models.User, issue *mo
|
|||
return
|
||||
}
|
||||
} else {
|
||||
mode, _ := models.AccessLevelUnit(doer, issue.Repo, models.UnitTypeIssues)
|
||||
mode, _ := models.AccessLevelUnit(doer, issue.Repo, unit.TypeIssues)
|
||||
apiIssue := &api.IssuePayload{
|
||||
Index: issue.Index,
|
||||
Issue: convert.ToAPIIssue(issue),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue