Skip to content
This repository

Flask.inject_url_defaults() incorrectly splits Blueprint's name #494

Open
ekoka opened this Issue April 19, 2012 · 0 comments

1 participant

ekoka
ekoka
ekoka commented April 19, 2012

The Flask.inject_url_defaults() function splits the endpoint at the wrong location to retrieve the name of the blueprint. This causes url_for() not to work properly for blueprints when combined with Blueprint.url_defaults()

e.g.
endpoint = "catalogue.admin.products.index"
bp = endpoint.split('.', 1)[0]

bp is now 'catalogue' rather than 'catalogue.admin.products'

I presume rsplit() would be more appropriate than split() for this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.