summaryrefslogtreecommitdiffstats
path: root/models/webhook.go
diff options
context:
space:
mode:
authorEthan Koenig <etk39@cornell.edu>2017-01-13 21:14:48 -0500
committerLunny Xiao <xiaolunwen@gmail.com>2017-01-14 10:14:48 +0800
commit27fcf8d30a8c8dda281739c84af4033c93d96faf (patch)
tree83c4c03b76539fc1907977e6ef8f32a08846a78d /models/webhook.go
parent87ad4961f62c24cf75377f3055e9769e269c80d9 (diff)
downloadgitea-27fcf8d30a8c8dda281739c84af4033c93d96faf.tar.gz
gitea-27fcf8d30a8c8dda281739c84af4033c93d96faf.zip
Bug fixes for webhook API (#650)
Diffstat (limited to 'models/webhook.go')
-rw-r--r--models/webhook.go4
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
}