-
Notifications
You must be signed in to change notification settings - Fork 886
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
When invoking an exception view, push the new threadlocals #3060
Conversation
This way when calling the threadlocal get_current_request() you get the same request object as the one that was passed to the view.
pyramid/view.py
Outdated
) | ||
|
||
try: | ||
manager.push({'request': request, 'registry': registry}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This push
should go before the try
. You do not want to try to pop
if the push
fails. It's pedantic but could avoid raising an exception from an exception.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gotcha. Will make the change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reminder bump
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
968c1a9
to
4f66355
Compare
This way when calling the threadlocal get_current_request() you get the
same request object as the one that was passed to the view.
Fixes the comment on: #3053 (comment)