diff options
author | Ethan Koenig <etk39@cornell.edu> | 2017-01-13 21:14:48 -0500 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2017-01-14 10:14:48 +0800 |
commit | 27fcf8d30a8c8dda281739c84af4033c93d96faf (patch) | |
tree | 83c4c03b76539fc1907977e6ef8f32a08846a78d /models/webhook.go | |
parent | 87ad4961f62c24cf75377f3055e9769e269c80d9 (diff) | |
download | gitea-27fcf8d30a8c8dda281739c84af4033c93d96faf.tar.gz gitea-27fcf8d30a8c8dda281739c84af4033c93d96faf.zip |
Bug fixes for webhook API (#650)
Diffstat (limited to 'models/webhook.go')
-rw-r--r-- | models/webhook.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/models/webhook.go b/models/webhook.go index c9c3c21a46..8f5c561939 100644 --- a/models/webhook.go +++ b/models/webhook.go @@ -258,8 +258,10 @@ func deleteWebhook(bean *Webhook) (err error) { return err } - if _, err = sess.Delete(bean); err != nil { + if count, err := sess.Delete(bean); err != nil { return err + } else if count == 0 { + return ErrWebhookNotExist{ID: bean.ID} } else if _, err = sess.Delete(&HookTask{HookID: bean.ID}); err != nil { return err } |