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

When invoking an exception view, push the new threadlocals #3060

Merged
merged 3 commits into from
Jun 5, 2017

Conversation

digitalresistor
Copy link
Member

@digitalresistor digitalresistor commented May 23, 2017

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)

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})
Copy link
Member

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.

Copy link
Member Author

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reminder bump

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@digitalresistor digitalresistor force-pushed the push_threadlocals_exception_view branch from 968c1a9 to 4f66355 Compare June 5, 2017 16:39
@mmerickel mmerickel merged commit 22215df into master Jun 5, 2017
mmerickel added a commit that referenced this pull request Jun 5, 2017
@mmerickel mmerickel deleted the push_threadlocals_exception_view branch June 5, 2017 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants