Browse Source

models/webhook: fix bad query

Unknwon 8 years ago
parent
commit
2322de653c
5 changed files with 4 additions and 11 deletions
  1. 1 1
      conf/locale/locale_en-US.ini
  2. 1 1
      gogs.go
  3. 1 8
      models/webhook.go
  4. 0 0
      modules/bindata/bindata.go
  5. 1 1
      templates/.VERSION

+ 1 - 1
conf/locale/locale_en-US.ini

@@ -938,7 +938,7 @@ dashboard.git_gc_repos = Do garbage collection on repositories
 dashboard.git_gc_repos_success = All repositories have done garbage collection successfully.
 dashboard.resync_all_sshkeys = Rewrite '.ssh/authorized_keys' file (caution: non-Gogs keys will be lost)
 dashboard.resync_all_sshkeys_success = All public keys have been rewritten successfully.
-dashboard.resync_all_hooks = Resync pre-receive, update and post-receive hooks of all repositories.
+dashboard.resync_all_hooks = Resync pre-receive, update and post-receive hooks of all repositories
 dashboard.resync_all_hooks_success = All repositories' pre-receive, update and post-receive hooks have been resynced successfully.
 dashboard.reinit_missing_repos = Reinitialize all repository records that lost Git files
 dashboard.reinit_missing_repos_success = All repository records that lost Git files have been reinitialized successfully.

+ 1 - 1
gogs.go

@@ -16,7 +16,7 @@ import (
 	"github.com/gogits/gogs/modules/setting"
 )
 
-const APP_VER = "0.9.160.0219"
+const APP_VER = "0.9.160.0220"
 
 func init() {
 	setting.AppVer = APP_VER

+ 1 - 8
models/webhook.go

@@ -216,10 +216,7 @@ func GetWebhookByOrgID(orgID, id int64) (*Webhook, error) {
 // GetActiveWebhooksByRepoID returns all active webhooks of repository.
 func GetActiveWebhooksByRepoID(repoID int64) ([]*Webhook, error) {
 	webhooks := make([]*Webhook, 0, 5)
-	return webhooks, x.Find(&webhooks, &Webhook{
-		RepoID:   repoID,
-		IsActive: true,
-	})
+	return webhooks, x.Where("repo_id = ?", repoID).And("is_active = ?", true).Find(&webhooks)
 }
 
 // GetWebhooksByRepoID returns all webhooks of a repository.
@@ -459,10 +456,6 @@ func PrepareWebhooks(repo *Repository, event HookEventType, p api.Payloader) err
 
 	var payloader api.Payloader
 	for _, w := range ws {
-		if !w.IsActive {
-			continue
-		}
-
 		switch event {
 		case HOOK_EVENT_CREATE:
 			if !w.HasCreateEvent() {

File diff suppressed because it is too large
+ 0 - 0
modules/bindata/bindata.go


+ 1 - 1
templates/.VERSION

@@ -1 +1 @@
-0.9.160.0219
+0.9.160.0220

Some files were not shown because too many files changed in this diff