diff options
author | Unknown <joe2010xtmf@163.com> | 2014-06-08 04:45:34 -0400 |
---|---|---|
committer | Unknown <joe2010xtmf@163.com> | 2014-06-08 04:45:34 -0400 |
commit | 302c863cda651130286838309d3d897cace93534 (patch) | |
tree | bc2b5e8efd513304806e1e900141856d3adfce48 /routers | |
parent | a0318db2f9094eda2beea19ed323244b4ae30831 (diff) | |
download | gitea-302c863cda651130286838309d3d897cace93534.tar.gz gitea-302c863cda651130286838309d3d897cace93534.zip |
Fix #242
Diffstat (limited to 'routers')
-rw-r--r-- | routers/admin/admin.go | 3 | ||||
-rw-r--r-- | routers/install.go | 3 | ||||
-rw-r--r-- | routers/repo/setting.go | 16 |
3 files changed, 12 insertions, 10 deletions
diff --git a/routers/admin/admin.go b/routers/admin/admin.go index 6f8868a659..56eba88a2b 100644 --- a/routers/admin/admin.go +++ b/routers/admin/admin.go @@ -193,6 +193,9 @@ func Config(ctx *middleware.Context) { ctx.Data["DbCfg"] = models.DbCfg + ctx.Data["WebhookTaskInterval"] = setting.WebhookTaskInterval + ctx.Data["WebhookDeliverTimeout"] = setting.WebhookDeliverTimeout + ctx.Data["MailerEnabled"] = false if setting.MailService != nil { ctx.Data["MailerEnabled"] = true diff --git a/routers/install.go b/routers/install.go index f44391a46c..eb0fc199cf 100644 --- a/routers/install.go +++ b/routers/install.go @@ -14,7 +14,6 @@ import ( "github.com/Unknwon/goconfig" "github.com/go-martini/martini" "github.com/go-xorm/xorm" - qlog "github.com/qiniu/log" "github.com/gogits/gogs/models" "github.com/gogits/gogs/modules/auth" @@ -56,7 +55,7 @@ func GlobalInit() { if setting.InstallLock { if err := models.NewEngine(); err != nil { - qlog.Fatal(err) + log.Fatal("Fail to initialize ORM engine: %v", err) } models.HasEngine = true diff --git a/routers/repo/setting.go b/routers/repo/setting.go index 0232dbcfe3..ac9ce7c77c 100644 --- a/routers/repo/setting.go +++ b/routers/repo/setting.go @@ -244,9 +244,9 @@ func WebHooksAddPost(ctx *middleware.Context, form auth.NewWebhookForm) { return } - ct := models.CT_JSON + ct := models.JSON if form.ContentType == "2" { - ct = models.CT_FORM + ct = models.FORM } w := &models.Webhook{ @@ -259,8 +259,8 @@ func WebHooksAddPost(ctx *middleware.Context, form auth.NewWebhookForm) { }, IsActive: form.Active, } - if err := w.SaveEvent(); err != nil { - ctx.Handle(500, "setting.WebHooksAddPost(SaveEvent)", err) + if err := w.UpdateEvent(); err != nil { + ctx.Handle(500, "setting.WebHooksAddPost(UpdateEvent)", err) return } else if err := models.CreateWebhook(w); err != nil { ctx.Handle(500, "setting.WebHooksAddPost(CreateWebhook)", err) @@ -311,9 +311,9 @@ func WebHooksEditPost(ctx *middleware.Context, params martini.Params, form auth. return } - ct := models.CT_JSON + ct := models.JSON if form.ContentType == "2" { - ct = models.CT_FORM + ct = models.FORM } w := &models.Webhook{ @@ -327,8 +327,8 @@ func WebHooksEditPost(ctx *middleware.Context, params martini.Params, form auth. }, IsActive: form.Active, } - if err := w.SaveEvent(); err != nil { - ctx.Handle(500, "setting.WebHooksEditPost(SaveEvent)", err) + if err := w.UpdateEvent(); err != nil { + ctx.Handle(500, "setting.WebHooksEditPost(UpdateEvent)", err) return } else if err := models.UpdateWebhook(w); err != nil { ctx.Handle(500, "setting.WebHooksEditPost(WebHooksEditPost)", err) |