incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [1/2] git commit: [#6556] turn on strict template vars for tests & dev
Date Tue, 13 Aug 2013 19:54:20 GMT
Updated Branches:
  refs/heads/db/6556 [created] d5230bd73


[#6556] turn on strict template vars for tests & dev


Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/42fc64f1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/42fc64f1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/42fc64f1

Branch: refs/heads/db/6556
Commit: 42fc64f1ef0e5b666bdb5d73300e561e9ab88bd7
Parents: fea4b5f
Author: Dave Brondsema <dbrondsema@slashdotmedia.com>
Authored: Tue Aug 13 19:53:58 2013 +0000
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Tue Aug 13 19:53:58 2013 +0000

----------------------------------------------------------------------
 Allura/allura/config/app_cfg.py | 5 ++++-
 Allura/development.ini          | 1 +
 Allura/test.ini                 | 2 ++
 3 files changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/42fc64f1/Allura/allura/config/app_cfg.py
----------------------------------------------------------------------
diff --git a/Allura/allura/config/app_cfg.py b/Allura/allura/config/app_cfg.py
index 6f15406..24f6d93 100644
--- a/Allura/allura/config/app_cfg.py
+++ b/Allura/allura/config/app_cfg.py
@@ -38,6 +38,7 @@ import pylons
 from tg.configuration import AppConfig, config
 from routes import Mapper
 from webhelpers.html import literal
+from paste.deploy.converters import asbool
 
 import ew
 
@@ -96,7 +97,9 @@ class ForgeConfig(AppConfig):
             auto_reload=config.auto_reload_templates,
             autoescape=True,
             bytecode_cache=bcc,
-            extensions=['jinja2.ext.do', 'jinja2.ext.i18n'])
+            extensions=['jinja2.ext.do', 'jinja2.ext.i18n'],
+            undefined=jinja2.StrictUndefined if asbool(config.get('jinja_strict_undefined'))
else jinja2.Undefined,
+            )
         jinja2_env.install_gettext_translations(pylons.i18n)
         jinja2_env.filters['filesizeformat'] = helpers.do_filesizeformat
         jinja2_env.filters['datetimeformat'] = helpers.datetimeformat

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/42fc64f1/Allura/development.ini
----------------------------------------------------------------------
diff --git a/Allura/development.ini b/Allura/development.ini
index 338b8ee..d3b65d8 100644
--- a/Allura/development.ini
+++ b/Allura/development.ini
@@ -52,6 +52,7 @@ base_url = http://localhost:8080
 
 #lang = ru
 cache_dir = %(here)s/data
+jinja_strict_undefined = true
 beaker.session.key = allura
 beaker.session.type = cookie
 beaker.session.secret = 61ece7db-ba8d-49fe-a923-ab444741708c

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/42fc64f1/Allura/test.ini
----------------------------------------------------------------------
diff --git a/Allura/test.ini b/Allura/test.ini
index 7394359..3b5a0cb 100644
--- a/Allura/test.ini
+++ b/Allura/test.ini
@@ -40,6 +40,8 @@ db_prefix = test_
 site_name = Allura
 base_url = http://localhost
 
+jinja_strict_undefined = true
+
 # Use test MongoDB DB server
 # ming.main.master = mongo://127.0.0.1:27018/allura
 ming.main.uri = mim:///allura


Mime
View raw message