From 33659ed9a5d95f13a4b10c06ba1e7c12e23ad6f0 Mon Sep 17 00:00:00 2001 From: Unknwon Date: Tue, 9 Sep 2014 10:17:35 -0400 Subject: Fix #452 --- models/webhook.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'models') diff --git a/models/webhook.go b/models/webhook.go index 6aac457b90..5c0e217975 100644 --- a/models/webhook.go +++ b/models/webhook.go @@ -99,7 +99,7 @@ func GetWebhookById(hookId int64) (*Webhook, error) { // GetActiveWebhooksByRepoId returns all active webhooks of repository. func GetActiveWebhooksByRepoId(repoId int64) (ws []*Webhook, err error) { - err = x.Find(&ws, &Webhook{RepoId: repoId, IsActive: true}) + err = x.Where("repo_id=?", repoId).And("is_active=?", true).Find(&ws) return ws, err } @@ -129,7 +129,7 @@ func GetWebhooksByOrgId(orgId int64) (ws []*Webhook, err error) { // GetActiveWebhooksByOrgId returns all active webhooks for an organization. func GetActiveWebhooksByOrgId(orgId int64) (ws []*Webhook, err error) { - err = x.Find(&ws, &Webhook{OrgId: orgId, IsActive: true}) + err = x.Where("org_id=?", orgId).And("is_active=?", true).Find(&ws) return ws, err } -- cgit v1.2.3