From ef6eb2cb04a80184114566dc1c7dbd617e132453 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonel=20C=C3=A2mara?= Date: Tue, 26 Feb 2019 11:43:58 +0000 Subject: [PATCH] Change the way Validator.translator is assigned so Validators can use self.translator --- gluon/compileapp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gluon/compileapp.py b/gluon/compileapp.py index c055f523..e7c2b7e8 100644 --- a/gluon/compileapp.py +++ b/gluon/compileapp.py @@ -429,7 +429,7 @@ def build_environment(request, response, session, store_current=True): c = environment['cache'] = Cache(request) # configure the validator to use the t translator - Validator.translator = T + Validator.translator = staticmethod(lambda text: None if text is None else str(T(text))) if store_current: current.globalenv = environment