flows: revert evaluate_on_call rename for backwards compatibility

This commit is contained in:
Jens Langhammer 2020-10-20 15:41:50 +02:00
parent 061eab4b36
commit ef021495ef
14 changed files with 36 additions and 41 deletions

View File

@ -137,7 +137,7 @@
}, },
"model": "passbook_flows.flowstagebinding", "model": "passbook_flows.flowstagebinding",
"attrs": { "attrs": {
"evaluate_on_call": false "re_evaluate_policies": false
} }
}, },
{ {
@ -149,7 +149,7 @@
}, },
"model": "passbook_flows.flowstagebinding", "model": "passbook_flows.flowstagebinding",
"attrs": { "attrs": {
"evaluate_on_call": false "re_evaluate_policies": false
} }
}, },
{ {
@ -161,7 +161,7 @@
}, },
"model": "passbook_flows.flowstagebinding", "model": "passbook_flows.flowstagebinding",
"attrs": { "attrs": {
"evaluate_on_call": false "re_evaluate_policies": false
} }
}, },
{ {
@ -173,7 +173,7 @@
}, },
"model": "passbook_flows.flowstagebinding", "model": "passbook_flows.flowstagebinding",
"attrs": { "attrs": {
"evaluate_on_call": false "re_evaluate_policies": false
} }
} }
] ]

View File

@ -156,7 +156,7 @@
}, },
"model": "passbook_flows.flowstagebinding", "model": "passbook_flows.flowstagebinding",
"attrs": { "attrs": {
"evaluate_on_call": false "re_evaluate_policies": false
} }
}, },
{ {
@ -168,7 +168,7 @@
}, },
"model": "passbook_flows.flowstagebinding", "model": "passbook_flows.flowstagebinding",
"attrs": { "attrs": {
"evaluate_on_call": false "re_evaluate_policies": false
} }
}, },
{ {
@ -180,7 +180,7 @@
}, },
"model": "passbook_flows.flowstagebinding", "model": "passbook_flows.flowstagebinding",
"attrs": { "attrs": {
"evaluate_on_call": false "re_evaluate_policies": false
} }
}, },
{ {
@ -192,7 +192,7 @@
}, },
"model": "passbook_flows.flowstagebinding", "model": "passbook_flows.flowstagebinding",
"attrs": { "attrs": {
"evaluate_on_call": false "re_evaluate_policies": false
} }
}, },
{ {
@ -204,7 +204,7 @@
}, },
"model": "passbook_flows.flowstagebinding", "model": "passbook_flows.flowstagebinding",
"attrs": { "attrs": {
"evaluate_on_call": false "re_evaluate_policies": false
} }
} }
] ]

View File

@ -68,7 +68,7 @@
}, },
"model": "passbook_flows.flowstagebinding", "model": "passbook_flows.flowstagebinding",
"attrs": { "attrs": {
"evaluate_on_call": false "re_evaluate_policies": false
} }
}, },
{ {
@ -80,7 +80,7 @@
}, },
"model": "passbook_flows.flowstagebinding", "model": "passbook_flows.flowstagebinding",
"attrs": { "attrs": {
"evaluate_on_call": false "re_evaluate_policies": false
} }
}, },
{ {
@ -92,7 +92,7 @@
}, },
"model": "passbook_flows.flowstagebinding", "model": "passbook_flows.flowstagebinding",
"attrs": { "attrs": {
"evaluate_on_call": false "re_evaluate_policies": false
} }
}, },
{ {
@ -104,7 +104,7 @@
}, },
"model": "passbook_flows.flowstagebinding", "model": "passbook_flows.flowstagebinding",
"attrs": { "attrs": {
"evaluate_on_call": false "re_evaluate_policies": false
} }
} }
] ]

View File

@ -71,7 +71,7 @@
}, },
"model": "passbook_flows.flowstagebinding", "model": "passbook_flows.flowstagebinding",
"attrs": { "attrs": {
"evaluate_on_call": false "re_evaluate_policies": false
} }
}, },
{ {
@ -83,7 +83,7 @@
}, },
"model": "passbook_flows.flowstagebinding", "model": "passbook_flows.flowstagebinding",
"attrs": { "attrs": {
"evaluate_on_call": false "re_evaluate_policies": false
} }
}, },
{ {
@ -96,7 +96,7 @@
"model": "passbook_flows.flowstagebinding", "model": "passbook_flows.flowstagebinding",
"attrs": { "attrs": {
"evaluate_on_plan": false, "evaluate_on_plan": false,
"evaluate_on_call": true "re_evaluate_policies": true
} }
}, },
{ {
@ -108,7 +108,7 @@
}, },
"model": "passbook_flows.flowstagebinding", "model": "passbook_flows.flowstagebinding",
"attrs": { "attrs": {
"evaluate_on_call": false "re_evaluate_policies": false
} }
}, },
{ {

View File

@ -130,7 +130,7 @@
}, },
"model": "passbook_flows.flowstagebinding", "model": "passbook_flows.flowstagebinding",
"attrs": { "attrs": {
"evaluate_on_call": false "re_evaluate_policies": false
} }
}, },
{ {
@ -142,7 +142,7 @@
}, },
"model": "passbook_flows.flowstagebinding", "model": "passbook_flows.flowstagebinding",
"attrs": { "attrs": {
"evaluate_on_call": false "re_evaluate_policies": false
} }
}, },
{ {
@ -154,7 +154,7 @@
}, },
"model": "passbook_flows.flowstagebinding", "model": "passbook_flows.flowstagebinding",
"attrs": { "attrs": {
"evaluate_on_call": false "re_evaluate_policies": false
} }
}, },
{ {
@ -166,7 +166,7 @@
}, },
"model": "passbook_flows.flowstagebinding", "model": "passbook_flows.flowstagebinding",
"attrs": { "attrs": {
"evaluate_on_call": false "re_evaluate_policies": false
} }
}, },
{ {
@ -178,7 +178,7 @@
}, },
"model": "passbook_flows.flowstagebinding", "model": "passbook_flows.flowstagebinding",
"attrs": { "attrs": {
"evaluate_on_call": false "re_evaluate_policies": false
} }
} }
] ]

View File

@ -30,7 +30,7 @@
}, },
"model": "passbook_flows.flowstagebinding", "model": "passbook_flows.flowstagebinding",
"attrs": { "attrs": {
"evaluate_on_call": false "re_evaluate_policies": false
} }
} }
] ]

View File

@ -32,7 +32,7 @@ class FlowStageBindingSerializer(ModelSerializer):
"target", "target",
"stage", "stage",
"evaluate_on_plan", "evaluate_on_plan",
"evaluate_on_call", "re_evaluate_policies",
"order", "order",
"policies", "policies",
] ]

View File

@ -51,7 +51,7 @@ class FlowStageBindingForm(forms.ModelForm):
"target", "target",
"stage", "stage",
"evaluate_on_plan", "evaluate_on_plan",
"evaluate_on_call", "re_evaluate_policies",
"order", "order",
] ]
widgets = { widgets = {

View File

@ -10,14 +10,9 @@ class Migration(migrations.Migration):
] ]
operations = [ operations = [
migrations.RenameField(
model_name="flowstagebinding",
old_name="re_evaluate_policies",
new_name="evaluate_on_call",
),
migrations.AlterField( migrations.AlterField(
model_name="flowstagebinding", model_name="flowstagebinding",
name="evaluate_on_call", name="re_evaluate_policies",
field=models.BooleanField( field=models.BooleanField(
default=False, default=False,
help_text="Evaluate policies when the Stage is present to the user.", help_text="Evaluate policies when the Stage is present to the user.",

View File

@ -163,7 +163,7 @@ class FlowStageBinding(SerializerModel, PolicyBindingModel):
) )
), ),
) )
evaluate_on_call = models.BooleanField( re_evaluate_policies = models.BooleanField(
default=False, default=False,
help_text=_("Evaluate policies when the Stage is present to the user."), help_text=_("Evaluate policies when the Stage is present to the user."),
) )

View File

@ -185,7 +185,7 @@ class FlowPlanner:
stage=binding.stage, stage=binding.stage,
flow=self.flow, flow=self.flow,
) )
if binding.evaluate_on_call and stage: if binding.re_evaluate_policies and stage:
LOGGER.debug( LOGGER.debug(
"f(plan): Stage has re-evaluate marker", "f(plan): Stage has re-evaluate marker",
stage=binding.stage, stage=binding.stage,

View File

@ -132,7 +132,7 @@ class TestFlowPlanner(TestCase):
target=flow, target=flow,
stage=DummyStage.objects.create(name="dummy1"), stage=DummyStage.objects.create(name="dummy1"),
order=0, order=0,
evaluate_on_call=True, re_evaluate_policies=True,
) )
request = self.request_factory.get( request = self.request_factory.get(
@ -161,7 +161,7 @@ class TestFlowPlanner(TestCase):
target=flow, target=flow,
stage=DummyStage.objects.create(name="dummy2"), stage=DummyStage.objects.create(name="dummy2"),
order=1, order=1,
evaluate_on_call=True, re_evaluate_policies=True,
) )
PolicyBinding.objects.create(policy=false_policy, target=binding2, order=0) PolicyBinding.objects.create(policy=false_policy, target=binding2, order=0)

View File

@ -174,7 +174,7 @@ class TestFlowExecutor(TestCase):
target=flow, target=flow,
stage=DummyStage.objects.create(name="dummy2"), stage=DummyStage.objects.create(name="dummy2"),
order=1, order=1,
evaluate_on_call=True, re_evaluate_policies=True,
) )
PolicyBinding.objects.create(policy=false_policy, target=binding2, order=0) PolicyBinding.objects.create(policy=false_policy, target=binding2, order=0)
@ -225,7 +225,7 @@ class TestFlowExecutor(TestCase):
target=flow, target=flow,
stage=DummyStage.objects.create(name="dummy2"), stage=DummyStage.objects.create(name="dummy2"),
order=1, order=1,
evaluate_on_call=True, re_evaluate_policies=True,
) )
binding3 = FlowStageBinding.objects.create( binding3 = FlowStageBinding.objects.create(
target=flow, stage=DummyStage.objects.create(name="dummy3"), order=2 target=flow, stage=DummyStage.objects.create(name="dummy3"), order=2
@ -292,13 +292,13 @@ class TestFlowExecutor(TestCase):
target=flow, target=flow,
stage=DummyStage.objects.create(name="dummy2"), stage=DummyStage.objects.create(name="dummy2"),
order=1, order=1,
evaluate_on_call=True, re_evaluate_policies=True,
) )
binding3 = FlowStageBinding.objects.create( binding3 = FlowStageBinding.objects.create(
target=flow, target=flow,
stage=DummyStage.objects.create(name="dummy3"), stage=DummyStage.objects.create(name="dummy3"),
order=2, order=2,
evaluate_on_call=True, re_evaluate_policies=True,
) )
binding4 = FlowStageBinding.objects.create( binding4 = FlowStageBinding.objects.create(
target=flow, stage=DummyStage.objects.create(name="dummy4"), order=2 target=flow, stage=DummyStage.objects.create(name="dummy4"), order=2

View File

@ -838,7 +838,7 @@ paths:
description: '' description: ''
required: false required: false
type: string type: string
- name: evaluate_on_call - name: re_evaluate_policies
in: query in: query
description: '' description: ''
required: false required: false
@ -6347,7 +6347,7 @@ definitions:
description: Evaluate policies during the Flow planning process. Disable this description: Evaluate policies during the Flow planning process. Disable this
for input-based policies. for input-based policies.
type: boolean type: boolean
evaluate_on_call: re_evaluate_policies:
title: Evaluate on call title: Evaluate on call
description: Evaluate policies when the Stage is present to the user. description: Evaluate policies when the Stage is present to the user.
type: boolean type: boolean