Update with macaron

This commit is contained in:
Unknwon 2014-10-06 19:12:52 -04:00
parent 64c68220d2
commit 1e1f9e7166
4 changed files with 10 additions and 8 deletions

View File

@ -11,7 +11,7 @@ watch_dirs = [
watch_exts = [".go", ".ini"] watch_exts = [".go", ".ini"]
build_delay = 1500 build_delay = 1500
cmds = [ cmds = [
["go", "install"], ["go", "install", "-tags", "sqlite"],
["go", "build"], ["go", "build", "-tags", "sqlite"],
["./gogs", "web"] ["./gogs", "web"]
] ]

View File

@ -61,10 +61,14 @@ func checkVersion() {
log.Fatal(4, "Binary and template file version does not match, did you forget to recompile?") 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], ".")) macaronVer := git.MustParseVersion(strings.Join(strings.Split(macaron.Version(), ".")[:3], "."))
if macaronVer.LessThan(git.MustParseVersion("0.1.8")) { if macaronVer.LessThan(git.MustParseVersion("0.2.0")) {
log.Fatal(4, "Macaron version does not match, did you forget to update?(github.com/Unknwon/macaron)") 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)")
} }
} }

View File

@ -29,7 +29,6 @@ import (
// Context represents context of a request. // Context represents context of a request.
type Context struct { type Context struct {
*macaron.Context *macaron.Context
i18n.Locale
Cache cache.Cache Cache cache.Cache
csrf csrf.CSRF csrf csrf.CSRF
Flash *session.Flash 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) { return func(c *macaron.Context, l i18n.Locale, cache cache.Cache, sess session.Store, f *session.Flash, x csrf.CSRF) {
ctx := &Context{ ctx := &Context{
Context: c, Context: c,
Locale: l,
Cache: cache, Cache: cache,
csrf: x, csrf: x,
Flash: f, Flash: f,

View File

@ -92,7 +92,7 @@ func SettingsDelete(ctx *middleware.Context) {
ctx.Handle(500, "DeleteOrganization", err) ctx.Handle(500, "DeleteOrganization", err)
} }
} else { } else {
log.Trace("Organization deleted: %s", ctx.User.Name) log.Trace("Organization deleted: %s", org.Name)
ctx.Redirect(setting.AppSubUrl + "/") ctx.Redirect(setting.AppSubUrl + "/")
} }
return return