Skip to content


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

ekoka opened this Issue · 0 comments

1 participant


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()

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.