diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2019-12-01 10:44:39 +0800 |
---|---|---|
committer | techknowlogick <techknowlogick@gitea.io> | 2019-11-30 21:44:39 -0500 |
commit | 2011a5b8183fe227f9f57f861dbe42abbd7abf42 (patch) | |
tree | cc34a5a20b3d8851f4dd139ce3a8356817883e1b /models/issue_assignees.go | |
parent | 7c6f2e27becb7ab43fe266d2882a0d80977c2ef7 (diff) | |
download | gitea-2011a5b8183fe227f9f57f861dbe42abbd7abf42.tar.gz gitea-2011a5b8183fe227f9f57f861dbe42abbd7abf42.zip |
Extract createComment (#9125)
* Extract createComment
* fix lint
* fix lint
Diffstat (limited to 'models/issue_assignees.go')
-rw-r--r-- | models/issue_assignees.go | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/models/issue_assignees.go b/models/issue_assignees.go index 08a567c4eb..c78132db5d 100644 --- a/models/issue_assignees.go +++ b/models/issue_assignees.go @@ -131,18 +131,22 @@ func (issue *Issue) toggleAssignee(sess *xorm.Session, doer *User, assigneeID in return false, nil, fmt.Errorf("loadRepo: %v", err) } - // Comment - comment, err = createComment(sess, &CreateCommentOptions{ + var opts = &CreateCommentOptions{ Type: CommentTypeAssignees, Doer: doer, Repo: issue.Repo, Issue: issue, RemovedAssignee: removed, AssigneeID: assigneeID, - }) + } + // Comment + comment, err = createCommentWithNoAction(sess, opts) if err != nil { return false, nil, fmt.Errorf("createComment: %v", err) } + if err = sendCreateCommentAction(sess, opts, comment); err != nil { + return false, nil, err + } // if pull request is in the middle of creation - don't call webhook if isCreate { |