Skip to content

Commit

Permalink
make template vars clean active
Browse files Browse the repository at this point in the history
  • Loading branch information
tobes committed Mar 28, 2012
1 parent 19965ff commit 5a06b6f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions ckan/config/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@
from pylons.i18n.translation import ugettext
from genshi.template import TemplateLoader
from genshi.filters.i18n import Translator
from paste.deploy.converters import asbool

import ckan.lib.app_globals as app_globals
import ckan.lib.helpers
import ckan.lib.helpers as h
from ckan.config.routing import make_map
from ckan import model
from ckan import plugins
Expand Down Expand Up @@ -97,7 +98,11 @@ def find_controller(self, controller):

config['routes.map'] = make_map()
config['pylons.app_globals'] = app_globals.Globals()
config['pylons.h'] = ckan.lib.helpers
if asbool(config.get('ckan.restrict_template_vars', 'false')):
import ckan.lib.helpers_clean
config['pylons.h'] = ckan.lib.helpers_clean
else:
config['pylons.h'] = h

## redo template setup to use genshi.search_path (so remove std template setup)
template_paths = [paths['templates'][0]]
Expand Down

0 comments on commit 5a06b6f

Please sign in to comment.