]> source.dussan.org Git - gitea.git/commitdiff
dont' send assign webhooks when creating issue (#5365)
authorLunny Xiao <xiaolunwen@gmail.com>
Tue, 20 Nov 2018 17:10:18 +0000 (01:10 +0800)
committertechknowlogick <hello@techknowlogick.com>
Tue, 20 Nov 2018 17:10:18 +0000 (12:10 -0500)
models/issue_assignees.go

index b4f346974b31179696e1009ad470e054ee9206c2..09d4d310dc6bd8cceffafbf03fe63f52b7845162 100644 (file)
@@ -159,12 +159,13 @@ func (issue *Issue) changeAssignee(sess *xorm.Session, doer *User, assigneeID in
                return fmt.Errorf("createAssigneeComment: %v", err)
        }
 
+       // if issue/pull is in the middle of creation - don't call webhook
+       if isCreate {
+               return nil
+       }
+
        mode, _ := accessLevel(sess, doer.ID, issue.Repo)
        if issue.IsPull {
-               // if pull request is in the middle of creation - don't call webhook
-               if isCreate {
-                       return nil
-               }
                if err = issue.loadPullRequest(sess); err != nil {
                        return fmt.Errorf("loadPullRequest: %v", err)
                }