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

Check that request.session exists when testing for impersonation #86

Merged
merged 1 commit into from
Nov 7, 2019

Conversation

gadybadger
Copy link
Contributor

@gadybadger gadybadger commented Nov 7, 2019

I ran into an issue with loginas where the context processor for adding the is_impersonated variable to templates can conflict with installed middleware.

This seems to be caused by the request not having a session property in all cases after passing through all of the middleware, and before passing through all of the context processors.

The fix here is to simply check if the session property exists, otherwise the is_impersonated_session method will always return False.

@skorokithakis skorokithakis merged commit fea9ae5 into skorokithakis:master Nov 7, 2019
@skorokithakis
Copy link
Owner

Looks good, thank you!

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.

None yet

2 participants