Skip to content

Commit 0742f71

Browse files
authored
fix duplicated webhook when creating issue with assignees (#7681)
1 parent ce27e48 commit 0742f71

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

models/issue_assignees.go

+6-3
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,15 @@ func (issue *Issue) ChangeAssignee(doer *User, assigneeID int64) (err error) {
142142
return err
143143
}
144144

145-
return sess.Commit()
145+
if err := sess.Commit(); err != nil {
146+
return err
147+
}
148+
149+
go HookQueue.Add(issue.RepoID)
150+
return nil
146151
}
147152

148153
func (issue *Issue) changeAssignee(sess *xorm.Session, doer *User, assigneeID int64, isCreate bool) (err error) {
149-
150154
// Update the assignee
151155
removed, err := updateIssueAssignee(sess, issue, assigneeID)
152156
if err != nil {
@@ -209,7 +213,6 @@ func (issue *Issue) changeAssignee(sess *xorm.Session, doer *User, assigneeID in
209213
return nil
210214
}
211215
}
212-
go HookQueue.Add(issue.RepoID)
213216
return nil
214217
}
215218

0 commit comments

Comments
 (0)