flows: save entire GET params from shell executor
This commit is contained in:
@ -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
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user