Change the way Validator.translator is assigned so Validators can use self.translator

This commit is contained in:
Leonel Câmara
2019-02-26 11:43:58 +00:00
committed by GitHub
parent be3343e4af
commit ef6eb2cb04
+1 -1
View File
@@ -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