Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

fix @before_first_request rasing exception #940

Closed
wants to merge 2 commits into
from

Conversation

Projects
None yet
2 participants

I tried using @before_first_request but ran into an AssertionError in @setupmethod because before actually executing the functions app._got_first_request was set to True indicating it's already too late. So I just moved it after the execution of the functions. Also I made the decorator leave the functions intact so they could be used directly.

Tim Mundt added some commits Jan 2, 2014

Tim Mundt set app._got_first_request to True only after executing 'before_first…
…_request_funcs' to prevent AssertionError in @setupmethod
5580514
Tim Mundt return decorated @before_first_request functions so they can be calle…
…d directly
3c9f63a
Owner

mitsuhiko commented Feb 8, 2014

Do you have a test of how you triggered this? A @setupmethod should never be a @before_first_request method.

@mitsuhiko mitsuhiko closed this Feb 8, 2014

Within the @before_first_request method I'm calling a function that is a @setupmethod. Also a "do not"?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment