diff --git a/e2e/test_provider_oidc.py b/e2e/test_provider_oidc.py index f6c75d959..3c44b9544 100644 --- a/e2e/test_provider_oidc.py +++ b/e2e/test_provider_oidc.py @@ -222,7 +222,9 @@ class TestProviderOIDC(SeleniumTestCase): self.driver.find_element(By.CSS_SELECTOR, "[type=submit]").click() self.wait.until( - ec.presence_of_element_located((By.XPATH, "//a[contains(@href, '/profile')]")) + ec.presence_of_element_located( + (By.XPATH, "//a[contains(@href, '/profile')]") + ) ) self.driver.find_element(By.XPATH, "//a[contains(@href, '/profile')]").click() self.assertEqual( diff --git a/e2e/utils.py b/e2e/utils.py index fa6876796..68fc787ec 100644 --- a/e2e/utils.py +++ b/e2e/utils.py @@ -1,10 +1,10 @@ """passbook e2e testing utilities""" -from time import time from functools import lru_cache from glob import glob from importlib.util import module_from_spec, spec_from_file_location from inspect import getmembers, isfunction from os import makedirs +from time import time from Cryptodome.PublicKey import RSA from django.apps import apps diff --git a/passbook/flows/views.py b/passbook/flows/views.py index eea803b43..0182afa53 100644 --- a/passbook/flows/views.py +++ b/passbook/flows/views.py @@ -27,7 +27,7 @@ LOGGER = get_logger() # Argument used to redirect user after login NEXT_ARG_NAME = "next" SESSION_KEY_PLAN = "passbook_flows_plan" -SESSION_KEY_NEXT = "passbook_flows_shell_next" +SESSION_KEY_GET = "passbook_flows_get" @method_decorator(xframe_options_sameorigin, name="dispatch") @@ -129,8 +129,8 @@ class FlowExecutorView(View): """User Successfully passed all stages""" self.cancel() # Since this is wrapped by the ExecutorShell, the next argument is saved in the session - next_param = self.request.session.get( - SESSION_KEY_NEXT, "passbook_core:overview" + next_param = self.request.session.get(SESSION_KEY_GET, {}).get( + NEXT_ARG_NAME, "passbook_core:overview" ) return redirect_with_qs(next_param) @@ -214,10 +214,7 @@ class FlowExecutorShellView(TemplateView): def get_context_data(self, **kwargs) -> Dict[str, Any]: kwargs["exec_url"] = reverse("passbook_flows:flow-executor", kwargs=self.kwargs) kwargs["msg_url"] = reverse("passbook_api:messages-list") - if NEXT_ARG_NAME in self.request.GET: - next_arg = self.request.GET[NEXT_ARG_NAME] - LOGGER.debug("f(exec/shell): Saved next param", next=next_arg) - self.request.session[SESSION_KEY_NEXT] = next_arg + self.request.session[SESSION_KEY_GET] = self.request.GET return kwargs