aboutsummaryrefslogtreecommitdiffstats
path: root/models/issue_lock.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2019-12-01 10:44:39 +0800
committertechknowlogick <techknowlogick@gitea.io>2019-11-30 21:44:39 -0500
commit2011a5b8183fe227f9f57f861dbe42abbd7abf42 (patch)
treecc34a5a20b3d8851f4dd139ce3a8356817883e1b /models/issue_lock.go
parent7c6f2e27becb7ab43fe266d2882a0d80977c2ef7 (diff)
downloadgitea-2011a5b8183fe227f9f57f861dbe42abbd7abf42.tar.gz
gitea-2011a5b8183fe227f9f57f861dbe42abbd7abf42.zip
Extract createComment (#9125)
* Extract createComment * fix lint * fix lint
Diffstat (limited to 'models/issue_lock.go')
-rw-r--r--models/issue_lock.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/models/issue_lock.go b/models/issue_lock.go
index dc6655ad3b..05eca27ad6 100644
--- a/models/issue_lock.go
+++ b/models/issue_lock.go
@@ -45,16 +45,21 @@ func updateIssueLock(opts *IssueLockOptions, lock bool) error {
return err
}
- _, err := createComment(sess, &CreateCommentOptions{
+ var opt = &CreateCommentOptions{
Doer: opts.Doer,
Issue: opts.Issue,
Repo: opts.Issue.Repo,
Type: commentType,
Content: opts.Reason,
- })
+ }
+ comment, err := createCommentWithNoAction(sess, opt)
if err != nil {
return err
}
+ if err = sendCreateCommentAction(sess, opt, comment); err != nil {
+ return err
+ }
+
return sess.Commit()
}