From 38ad8e5fd39618c862cef0f4a35bba1703c09ef5 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Wed, 19 Feb 2020 11:01:20 +0100 Subject: [PATCH] policies/expression: fix pb_is_sso_flow --- passbook/core/views/authentication.py | 1 - passbook/policies/expression/evaluator.py | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/passbook/core/views/authentication.py b/passbook/core/views/authentication.py index 6ba55171f..f85aaa019 100644 --- a/passbook/core/views/authentication.py +++ b/passbook/core/views/authentication.py @@ -72,7 +72,6 @@ class LoginView(UserPassesTestMixin, FormView): if not pre_user: # No user found return self.invalid_login(self.request) - # self.request.session.flush() self.request.session[AuthenticationView.SESSION_PENDING_USER] = pre_user.pk return _redirect_with_qs("passbook_core:auth-process", self.request.GET) diff --git a/passbook/policies/expression/evaluator.py b/passbook/policies/expression/evaluator.py index 275999103..1e5bc26d6 100644 --- a/passbook/policies/expression/evaluator.py +++ b/passbook/policies/expression/evaluator.py @@ -47,7 +47,7 @@ class Evaluator: """Return dictionary with additional global variables passed to expression""" # update passbook/policies/expression/templates/policy/expression/form.html # update docs/policies/expression/index.md - kwargs["pb_is_sso_flow"] = request.user.session.get( + kwargs["pb_is_sso_flow"] = request.http_request.session.get( AuthenticationView.SESSION_IS_SSO_LOGIN, False ) kwargs["pb_is_group_member"] = Evaluator.jinja2_func_is_group_member