From 24d8290a3f5c9e21ad585d75ee142cb8c3582e57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=9C=E4=BA=9A=E5=93=B2?= Date: Mon, 16 Jan 2017 10:32:33 +0800 Subject: [PATCH 1/2] fix filter with __ne bug --- orm/db.go | 1 + 1 file changed, 1 insertion(+) diff --git a/orm/db.go b/orm/db.go index 30d8ae4e..bca6071d 100644 --- a/orm/db.go +++ b/orm/db.go @@ -48,6 +48,7 @@ var ( "lte": true, "eq": true, "nq": true, + "ne": true, "startswith": true, "endswith": true, "istartswith": true, From 9b714a75187e4ef066db2a6cf79c284723606c26 Mon Sep 17 00:00:00 2001 From: xhzhang Date: Mon, 6 Feb 2017 12:33:15 +0800 Subject: [PATCH 2/2] Add config field EnableErrorsRender Add config field EnableErrorsRender to disable errors output with the template data, sometimes we do not want errors output with it even in dev mode, especially in API projects. --- config.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/config.go b/config.go index 36bf445c..8d4b3c09 100644 --- a/config.go +++ b/config.go @@ -41,6 +41,7 @@ type Config struct { EnableGzip bool MaxMemory int64 EnableErrorsShow bool + EnableErrorsRender bool Listen Listen WebConfig WebConfig Log LogConfig @@ -174,7 +175,7 @@ func recoverPanic(ctx *context.Context) { logs.Critical(fmt.Sprintf("%s:%d", file, line)) stack = stack + fmt.Sprintln(fmt.Sprintf("%s:%d", file, line)) } - if BConfig.RunMode == DEV { + if BConfig.RunMode == DEV && BConfig.EnableErrorsRender { showErr(err, ctx, stack) } } @@ -192,6 +193,7 @@ func newBConfig() *Config { EnableGzip: false, MaxMemory: 1 << 26, //64MB EnableErrorsShow: true, + EnableErrorsRender: true, Listen: Listen{ Graceful: false, ServerTimeOut: 0,