mirror of
https://github.com/gogs/gogs.git
synced 2025-05-23 07:50:23 +00:00
models/webhook: fix bad query
This commit is contained in:
parent
95b94b2166
commit
2322de653c
@ -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.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 = 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_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.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 = Reinitialize all repository records that lost Git files
|
||||||
dashboard.reinit_missing_repos_success = All repository records that lost Git files have been reinitialized successfully.
|
dashboard.reinit_missing_repos_success = All repository records that lost Git files have been reinitialized successfully.
|
||||||
|
2
gogs.go
2
gogs.go
@ -16,7 +16,7 @@ import (
|
|||||||
"github.com/gogits/gogs/modules/setting"
|
"github.com/gogits/gogs/modules/setting"
|
||||||
)
|
)
|
||||||
|
|
||||||
const APP_VER = "0.9.160.0219"
|
const APP_VER = "0.9.160.0220"
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
setting.AppVer = APP_VER
|
setting.AppVer = APP_VER
|
||||||
|
@ -216,10 +216,7 @@ func GetWebhookByOrgID(orgID, id int64) (*Webhook, error) {
|
|||||||
// GetActiveWebhooksByRepoID returns all active webhooks of repository.
|
// GetActiveWebhooksByRepoID returns all active webhooks of repository.
|
||||||
func GetActiveWebhooksByRepoID(repoID int64) ([]*Webhook, error) {
|
func GetActiveWebhooksByRepoID(repoID int64) ([]*Webhook, error) {
|
||||||
webhooks := make([]*Webhook, 0, 5)
|
webhooks := make([]*Webhook, 0, 5)
|
||||||
return webhooks, x.Find(&webhooks, &Webhook{
|
return webhooks, x.Where("repo_id = ?", repoID).And("is_active = ?", true).Find(&webhooks)
|
||||||
RepoID: repoID,
|
|
||||||
IsActive: true,
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetWebhooksByRepoID returns all webhooks of a repository.
|
// 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
|
var payloader api.Payloader
|
||||||
for _, w := range ws {
|
for _, w := range ws {
|
||||||
if !w.IsActive {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
switch event {
|
switch event {
|
||||||
case HOOK_EVENT_CREATE:
|
case HOOK_EVENT_CREATE:
|
||||||
if !w.HasCreateEvent() {
|
if !w.HasCreateEvent() {
|
||||||
|
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
|||||||
0.9.160.0219
|
0.9.160.0220
|
Loading…
x
Reference in New Issue
Block a user