Skip to content

Commit

Permalink
Fixes #3796 and an issue with some deployments of CKAN losing API end…
Browse files Browse the repository at this point in the history
…points

This patch from @amercader resolves an issue reported on ckan-dev and IRC where sometimes flask routes aren't getting loaded and the action API is lost as a result. Incidentally, it fixes #3796 :-D
  • Loading branch information
mattfullerton committed Oct 6, 2017
1 parent 71e839a commit ef4b559
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ckan/config/middleware/flask_app.py
Expand Up @@ -355,7 +355,9 @@ def _register_core_blueprints(app):
def is_blueprint(mm):
return isinstance(mm, Blueprint)

for loader, name, _ in pkgutil.iter_modules(['ckan/views'], 'ckan.views.'):
path = os.path.join(os.path.dirname(__file__), '..', '..', 'views')

for loader, name, _ in pkgutil.iter_modules([path], 'ckan.views.'):
module = loader.find_module(name).load_module(name)
for blueprint in inspect.getmembers(module, is_blueprint):
app.register_blueprint(blueprint[1])
Expand Down

0 comments on commit ef4b559

Please sign in to comment.