summaryrefslogtreecommitdiffstats
path: root/models/issue_assignees.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2018-11-21 01:10:18 +0800
committertechknowlogick <hello@techknowlogick.com>2018-11-20 12:10:18 -0500
commit499bff43d935f1334a76b86fe3a44a5a670479ef (patch)
treed58f56eec3f0942f96d7f5419e6f9cd5ab6d01c1 /models/issue_assignees.go
parent3a95e2d0eac9834125c2e738ea5daf238c8fc9f7 (diff)
downloadgitea-499bff43d935f1334a76b86fe3a44a5a670479ef.tar.gz
gitea-499bff43d935f1334a76b86fe3a44a5a670479ef.zip
dont' send assign webhooks when creating issue (#5365)
Diffstat (limited to 'models/issue_assignees.go')
-rw-r--r--models/issue_assignees.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/models/issue_assignees.go b/models/issue_assignees.go
index b4f346974b..09d4d310dc 100644
--- a/models/issue_assignees.go
+++ b/models/issue_assignees.go
@@ -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)
}