mirror of
https://github.com/go-gitea/gitea.git
synced 2024-05-11 05:55:29 +00:00
Extract createComment (#9125)
* Extract createComment * fix lint * fix lint
This commit is contained in:
committed by
techknowlogick
parent
7c6f2e27be
commit
2011a5b818
@ -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 {
|
||||
|
Reference in New Issue
Block a user