Browse Source

models/webhook: fix bad query

pull/4157/head
Unknwon 8 years ago
parent
commit
2322de653c
No known key found for this signature in database
GPG Key ID: 25B575AE3213B2B3
  1. 2
      conf/locale/locale_en-US.ini
  2. 2
      gogs.go
  3. 9
      models/webhook.go
  4. 4
      modules/bindata/bindata.go
  5. 2
      templates/.VERSION

2
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.

2
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

9
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() {

4
modules/bindata/bindata.go

File diff suppressed because one or more lines are too long

2
templates/.VERSION

@ -1 +1 @@
0.9.160.0219
0.9.160.0220
Loading…
Cancel
Save