Skip to content

Commit

Permalink
Merge pull request #3340 from HighwayThree/3328-customized-error-hand…
Browse files Browse the repository at this point in the history
…ling

Moved ErrorController rout to right after plugins custom routes.
  • Loading branch information
wardi committed Dec 1, 2016
2 parents 356c645 + 3c6bc70 commit d211d3b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ckan/config/routing.py
Expand Up @@ -93,6 +93,10 @@ def make_map():
map.minimization = False
map.explicit = True

# CUSTOM ROUTES HERE
for plugin in p.PluginImplementations(p.IRoutes):
map = plugin.before_map(map)

# The ErrorController route (handles 404/500 error pages); it should
# likely stay at the top, ensuring it can always be resolved.
map.connect('/error/{action}', controller='error', ckan_core=True)
Expand All @@ -101,10 +105,6 @@ def make_map():
map.connect('*url', controller='home', action='cors_options',
conditions=OPTIONS, ckan_core=True)

# CUSTOM ROUTES HERE
for plugin in p.PluginImplementations(p.IRoutes):
map = plugin.before_map(map)

# Mark all routes added from extensions on the `before_map` extension point
# as non-core
for route in map.matchlist:
Expand Down

0 comments on commit d211d3b

Please sign in to comment.