From 1e1f9e716660533dc3c570b51006e4e36b2c3a7f Mon Sep 17 00:00:00 2001 From: Unknwon Date: Mon, 6 Oct 2014 19:12:52 -0400 Subject: [PATCH] Update with macaron --- .bra.toml | 4 ++-- cmd/web.go | 10 +++++++--- modules/middleware/context.go | 2 -- routers/org/setting.go | 2 +- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.bra.toml b/.bra.toml index a5afa2767..a5fcdf6ee 100644 --- a/.bra.toml +++ b/.bra.toml @@ -11,7 +11,7 @@ watch_dirs = [ watch_exts = [".go", ".ini"] build_delay = 1500 cmds = [ - ["go", "install"], - ["go", "build"], + ["go", "install", "-tags", "sqlite"], + ["go", "build", "-tags", "sqlite"], ["./gogs", "web"] ] \ No newline at end of file diff --git a/cmd/web.go b/cmd/web.go index 810e36d3b..201eb48f0 100644 --- a/cmd/web.go +++ b/cmd/web.go @@ -61,10 +61,14 @@ func checkVersion() { log.Fatal(4, "Binary and template file version does not match, did you forget to recompile?") } - // Macaron. + // Check dependency version. macaronVer := git.MustParseVersion(strings.Join(strings.Split(macaron.Version(), ".")[:3], ".")) - if macaronVer.LessThan(git.MustParseVersion("0.1.8")) { - log.Fatal(4, "Macaron version does not match, did you forget to update?(github.com/Unknwon/macaron)") + if macaronVer.LessThan(git.MustParseVersion("0.2.0")) { + log.Fatal(4, "Macaron version is too old, did you forget to update?(github.com/Unknwon/macaron)") + } + i18nVer := git.MustParseVersion(i18n.Version()) + if i18nVer.LessThan(git.MustParseVersion("0.0.1")) { + log.Fatal(4, "i18n version is too old, did you forget to update?(github.com/macaron-contrib/i18n)") } } diff --git a/modules/middleware/context.go b/modules/middleware/context.go index 90716d2c5..1d9f57389 100644 --- a/modules/middleware/context.go +++ b/modules/middleware/context.go @@ -29,7 +29,6 @@ import ( // Context represents context of a request. type Context struct { *macaron.Context - i18n.Locale Cache cache.Cache csrf csrf.CSRF Flash *session.Flash @@ -162,7 +161,6 @@ func Contexter() macaron.Handler { return func(c *macaron.Context, l i18n.Locale, cache cache.Cache, sess session.Store, f *session.Flash, x csrf.CSRF) { ctx := &Context{ Context: c, - Locale: l, Cache: cache, csrf: x, Flash: f, diff --git a/routers/org/setting.go b/routers/org/setting.go index 0522f9980..41ec4a214 100644 --- a/routers/org/setting.go +++ b/routers/org/setting.go @@ -92,7 +92,7 @@ func SettingsDelete(ctx *middleware.Context) { ctx.Handle(500, "DeleteOrganization", err) } } else { - log.Trace("Organization deleted: %s", ctx.User.Name) + log.Trace("Organization deleted: %s", org.Name) ctx.Redirect(setting.AppSubUrl + "/") } return