diff options
Diffstat (limited to 'services/issue/issue.go')
-rw-r--r-- | services/issue/issue.go | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/services/issue/issue.go b/services/issue/issue.go index e3571bd396..cb34a9eacd 100644 --- a/services/issue/issue.go +++ b/services/issue/issue.go @@ -7,6 +7,7 @@ package issue import ( "code.gitea.io/gitea/models" "code.gitea.io/gitea/models/db" + user_model "code.gitea.io/gitea/models/user" "code.gitea.io/gitea/modules/git" "code.gitea.io/gitea/modules/notification" "code.gitea.io/gitea/modules/util" @@ -41,7 +42,7 @@ func NewIssue(repo *models.Repository, issue *models.Issue, labelIDs []int64, uu } // ChangeTitle changes the title of this issue, as the given user. -func ChangeTitle(issue *models.Issue, doer *models.User, title string) (err error) { +func ChangeTitle(issue *models.Issue, doer *user_model.User, title string) (err error) { oldTitle := issue.Title issue.Title = title @@ -55,7 +56,7 @@ func ChangeTitle(issue *models.Issue, doer *models.User, title string) (err erro } // ChangeIssueRef changes the branch of this issue, as the given user. -func ChangeIssueRef(issue *models.Issue, doer *models.User, ref string) error { +func ChangeIssueRef(issue *models.Issue, doer *user_model.User, ref string) error { oldRef := issue.Ref issue.Ref = ref @@ -74,8 +75,8 @@ func ChangeIssueRef(issue *models.Issue, doer *models.User, ref string) error { // "assignees" (array): Logins for Users to assign to this issue. // Pass one or more user logins to replace the set of assignees on this Issue. // Send an empty array ([]) to clear all assignees from the Issue. -func UpdateAssignees(issue *models.Issue, oneAssignee string, multipleAssignees []string, doer *models.User) (err error) { - var allNewAssignees []*models.User +func UpdateAssignees(issue *models.Issue, oneAssignee string, multipleAssignees []string, doer *user_model.User) (err error) { + var allNewAssignees []*user_model.User // Keep the old assignee thingy for compatibility reasons if oneAssignee != "" { @@ -95,7 +96,7 @@ func UpdateAssignees(issue *models.Issue, oneAssignee string, multipleAssignees // Loop through all assignees to add them for _, assigneeName := range multipleAssignees { - assignee, err := models.GetUserByName(assigneeName) + assignee, err := user_model.GetUserByName(assigneeName) if err != nil { return err } @@ -125,8 +126,8 @@ func UpdateAssignees(issue *models.Issue, oneAssignee string, multipleAssignees // AddAssigneeIfNotAssigned adds an assignee only if he isn't already assigned to the issue. // Also checks for access of assigned user -func AddAssigneeIfNotAssigned(issue *models.Issue, doer *models.User, assigneeID int64) (err error) { - assignee, err := models.GetUserByID(assigneeID) +func AddAssigneeIfNotAssigned(issue *models.Issue, doer *user_model.User, assigneeID int64) (err error) { + assignee, err := user_model.GetUserByID(assigneeID) if err != nil { return err } |