Skip to content

Commit

Permalink
[master][#1708][xs]: Protect against import of controller/search code…
Browse files Browse the repository at this point in the history
… before config initialisation.
  • Loading branch information
David Read committed Jan 27, 2012
1 parent 02788e7 commit cb5bba7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ckan/config/routing.py
Expand Up @@ -8,14 +8,17 @@
from pylons import config
from routes import Mapper
from ckan.plugins import PluginImplementations, IRoutes
from ckan.controllers.package import register_pluggable_behaviour as register_package_behaviour
from ckan.controllers.group import register_pluggable_behaviour as register_group_behaviour


routing_plugins = PluginImplementations(IRoutes)

def make_map():
"""Create, configure and return the routes Mapper"""
# import controllers here rather than at root level because
# pylons config is initialised by this point.
from ckan.controllers.package import register_pluggable_behaviour as register_package_behaviour
from ckan.controllers.group import register_pluggable_behaviour as register_group_behaviour

map = Mapper(directory=config['pylons.paths']['controllers'],
always_scan=config['debug'])
map.minimization = False
Expand Down

0 comments on commit cb5bba7

Please sign in to comment.