-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Jinja/Flask get_flashed_messages
fails
#82
Comments
If I disable
However, the app runs fine if Flask-Injector is not installed. So far I haven't found any other methods in my actual web app with this issue. |
It's because: and, The following global variables are available within Jinja2 templates by default in the Standard Context So,
Or, the best solution, in my opinion:
I can't imagine a single use case where dependencies must be injected into the Standard template context. It's annoying and painful. |
I think the conclusion here would be the "inject in many places even if they don't declare they need injection" aspect of Flask-Injector's behavior is problematic. It'd be a breaking change but I'm open to changing that. |
Flask-Injector 0.14.0
Injector 0.20.1
Flask 2.1.3
Minimum reproducible example: https://gist.github.com/NoRePercussions/00a26a4d801a91b01a916f818dd27092
Summary
get_flashed_messages
from Flask gets a list of internal messagesget_flashed_messages
, F-I attempts to inject:Other concerns
The text was updated successfully, but these errors were encountered: