diff --git a/passbook/flows/markers.py b/passbook/flows/markers.py index f4fd97178..628f0cf28 100644 --- a/passbook/flows/markers.py +++ b/passbook/flows/markers.py @@ -36,6 +36,7 @@ class ReevaluateMarker(StageMarker): def process(self, plan: "FlowPlan", stage: Stage) -> Optional[Stage]: """Re-evaluate policies bound to stage, and if they fail, remove from plan""" engine = PolicyEngine(self.binding, self.user) + engine.use_cache = False engine.request.context = plan.context engine.build() result = engine.result diff --git a/passbook/flows/views.py b/passbook/flows/views.py index 65abf7ff3..affbe4536 100644 --- a/passbook/flows/views.py +++ b/passbook/flows/views.py @@ -138,6 +138,10 @@ class FlowExecutorView(View): stage_class=class_to_path(self.current_stage_view.__class__), flow_slug=self.flow.slug, ) + # We call plan.next here to check for re-evaluate markers + # this is important so we can save the result + # and we don't have to re-evaluate the policies each request + self.plan.next() self.plan.pop() self.request.session[SESSION_KEY_PLAN] = self.plan if self.plan.stages: