Skip to content
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

Unify setupmethod behavior between Flask and Blueprint #4571

Closed
davidism opened this issue May 2, 2022 · 2 comments · Fixed by #4577
Closed

Unify setupmethod behavior between Flask and Blueprint #4571

davidism opened this issue May 2, 2022 · 2 comments · Fixed by #4577
Assignees
Labels
save-for-sprint Please don't pick this unless you're participating in an official sprint.
Milestone

Comments

@davidism
Copy link
Member

davidism commented May 2, 2022

Many of the methods in the Flask app object are decorated with setupmethod, which prevents registering things with the application after it starts running. A similar behavior is in Blueprint, we want to prevent modifying it after registering it at least once. However, the blueprint checking is much less consistent, it's divided up into two parts, is only a warning sometimes, and has a different message. Figure out how we can make Flask and Blueprint more consistent with this error.

@davidism davidism added the save-for-sprint Please don't pick this unless you're participating in an official sprint. label May 2, 2022
@hallacy
Copy link
Contributor

hallacy commented May 2, 2022

@davidism I can start on this one

@davidism
Copy link
Member Author

I also noticed that setting app.debug, ConfigAttribute, and app.config keys, could also reasonably be considered setup. I haven't applied a warning or error to these yet, but it's something to think about. It's a little more complicated because technically config should be finished as soon as the extension that uses it (or the app) is initialized. There are also other things, such as template config that shouldn't change after app.jinja_env is accessed, or static URL config after the static route is added.

@davidism davidism added this to the 2.2.0 milestone May 23, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
save-for-sprint Please don't pick this unless you're participating in an official sprint.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants