Skip to content

Commit

Permalink
Merge pull request #4926 from DataShades/unified-webassets-endpoint
Browse files Browse the repository at this point in the history
Add unified(dot) name for webassets endpoint(`webassets.index`)
  • Loading branch information
amercader committed Jul 26, 2019
2 parents 1fa8360 + f991296 commit af33aeb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ckan/config/middleware/flask_app.py
Expand Up @@ -512,6 +512,6 @@ def _setup_webassets(app):

webassets_folder = get_webassets_path()

@app.route('/webassets/<path:path>')
@app.route('/webassets/<path:path>', endpoint='webassets.index')
def webassets(path):
return send_from_directory(webassets_folder, path)
11 changes: 9 additions & 2 deletions ckan/tests/config/test_middleware.py
Expand Up @@ -106,10 +106,17 @@ def test_view():
return 'This was served from Flask'

# This endpoint is defined both in Flask and in Pylons core
flask_app.add_url_rule('/flask_core', view_func=test_view)
flask_app.add_url_rule(
'/flask_core',
view_func=test_view,
endpoint='flask_core.index')

# This endpoint is defined both in Flask and a Pylons extension
flask_app.add_url_rule('/pylons_and_flask', view_func=test_view)
flask_app.add_url_rule(
'/pylons_and_flask',
view_func=test_view,
endpoint='pylons_and_flask.index'
)

def test_ask_around_is_called(self):

Expand Down

0 comments on commit af33aeb

Please sign in to comment.