diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2019-07-31 17:24:38 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-31 17:24:38 +0800 |
commit | 0742f717adc9739653b78032c71a5360c0885476 (patch) | |
tree | fdab33b971d43fb8c3c0b710ca2c62e507eeea9d /models | |
parent | ce27e48fe337b250ec1529895927c4285d36f8f0 (diff) | |
download | gitea-0742f717adc9739653b78032c71a5360c0885476.tar.gz gitea-0742f717adc9739653b78032c71a5360c0885476.zip |
fix duplicated webhook when creating issue with assignees (#7681)
Diffstat (limited to 'models')
-rw-r--r-- | models/issue_assignees.go | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/models/issue_assignees.go b/models/issue_assignees.go index f6a2afe2c9..d88a4218cf 100644 --- a/models/issue_assignees.go +++ b/models/issue_assignees.go @@ -142,11 +142,15 @@ func (issue *Issue) ChangeAssignee(doer *User, assigneeID int64) (err error) { return err } - return sess.Commit() + if err := sess.Commit(); err != nil { + return err + } + + go HookQueue.Add(issue.RepoID) + return nil } func (issue *Issue) changeAssignee(sess *xorm.Session, doer *User, assigneeID int64, isCreate bool) (err error) { - // Update the assignee removed, err := updateIssueAssignee(sess, issue, assigneeID) if err != nil { @@ -209,7 +213,6 @@ func (issue *Issue) changeAssignee(sess *xorm.Session, doer *User, assigneeID in return nil } } - go HookQueue.Add(issue.RepoID) return nil } |