flows/transfer: fix missing unique fields for PolicyBinding
This commit is contained in:
parent
bb9ae28be8
commit
28893b9695
|
@ -52,7 +52,7 @@ class FlowExporter:
|
|||
yield FlowBundleEntry.from_model(policy)
|
||||
bindings = PolicyBinding.objects.filter(target__in=pbm_uuids).select_related()
|
||||
for binding in bindings:
|
||||
yield FlowBundleEntry.from_model(binding)
|
||||
yield FlowBundleEntry.from_model(binding, "policy", "target", "order")
|
||||
|
||||
def walk_stage_prompts(self) -> Iterator[FlowBundleEntry]:
|
||||
"""Walk over all prompts associated with any PromptStages"""
|
||||
|
|
|
@ -12,7 +12,7 @@ class PolicyBindingSerializer(ModelSerializer):
|
|||
class Meta:
|
||||
|
||||
model = PolicyBinding
|
||||
fields = ["policy", "target", "enabled", "order", "timeout"]
|
||||
fields = ["pk", "policy", "target", "enabled", "order", "timeout"]
|
||||
|
||||
|
||||
class PolicyBindingViewSet(ModelViewSet):
|
||||
|
|
|
@ -44,7 +44,7 @@ class PolicyBinding(SerializerModel):
|
|||
enabled = models.BooleanField(default=True)
|
||||
|
||||
policy = InheritanceForeignKey("Policy", on_delete=models.CASCADE, related_name="+")
|
||||
target = models.ForeignKey(
|
||||
target = InheritanceForeignKey(
|
||||
PolicyBindingModel, on_delete=models.CASCADE, related_name="+"
|
||||
)
|
||||
negate = models.BooleanField(
|
||||
|
|
|
@ -6243,6 +6243,11 @@ definitions:
|
|||
- order
|
||||
type: object
|
||||
properties:
|
||||
pk:
|
||||
title: Policy binding uuid
|
||||
type: string
|
||||
format: uuid
|
||||
readOnly: true
|
||||
policy:
|
||||
title: Policy
|
||||
type: string
|
||||
|
|
Reference in New Issue