From 74731c3a5aea71c81e4ca75bde96154f3adf3cfa Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Tue, 29 Mar 2022 22:57:33 +0800 Subject: Move some issue methods as functions (#19255) * Move some issue methods as functions * Fix bug --- models/issue_assignees.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'models/issue_assignees.go') diff --git a/models/issue_assignees.go b/models/issue_assignees.go index b3511f8b59..a91793f2f1 100644 --- a/models/issue_assignees.go +++ b/models/issue_assignees.go @@ -92,15 +92,15 @@ func clearAssigneeByUserID(sess db.Engine, userID int64) (err error) { return } -// ToggleAssignee changes a user between assigned and not assigned for this issue, and make issue comment for it. -func (issue *Issue) ToggleAssignee(doer *user_model.User, assigneeID int64) (removed bool, comment *Comment, err error) { +// ToggleIssueAssignee changes a user between assigned and not assigned for this issue, and make issue comment for it. +func ToggleIssueAssignee(issue *Issue, doer *user_model.User, assigneeID int64) (removed bool, comment *Comment, err error) { ctx, committer, err := db.TxContext() if err != nil { return false, nil, err } defer committer.Close() - removed, comment, err = issue.toggleAssignee(ctx, doer, assigneeID, false) + removed, comment, err = toggleIssueAssignee(ctx, issue, doer, assigneeID, false) if err != nil { return false, nil, err } @@ -112,7 +112,7 @@ func (issue *Issue) ToggleAssignee(doer *user_model.User, assigneeID int64) (rem return removed, comment, nil } -func (issue *Issue) toggleAssignee(ctx context.Context, doer *user_model.User, assigneeID int64, isCreate bool) (removed bool, comment *Comment, err error) { +func toggleIssueAssignee(ctx context.Context, issue *Issue, doer *user_model.User, assigneeID int64, isCreate bool) (removed bool, comment *Comment, err error) { sess := db.GetEngine(ctx) removed, err = toggleUserAssignee(sess, issue, assigneeID) if err != nil { -- cgit v1.2.3