diff options
author | Lunny Xiao | 2019-07-31 19:39:34 +0800 |
---|---|---|
committer | Lauris BH | 2019-07-31 14:39:33 +0300 |
commit | ee43d20d3b463457d67fdbce312a571626b4ed6c (patch) | |
tree | 17eaa96e161ec9959407e690de87f073760e23f1 | |
parent | 99ffd826e5d1b42f15994a0de987d93a83e8a2ca (diff) |
fix duplicated webhook when creating issue with assignees (#7681) (#7684)
-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 f6a2afe2c..d88a4218c 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 } |