blueprints: fix exporter not ignoring non-SerializerModel objects

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2022-08-18 17:27:11 +02:00
parent 1ad4c8fc29
commit 0cfffa28ad
1 changed files with 3 additions and 0 deletions

View File

@ -17,6 +17,7 @@ from authentik.blueprints.v1.common import (
from authentik.blueprints.v1.importer import is_model_allowed from authentik.blueprints.v1.importer import is_model_allowed
from authentik.blueprints.v1.labels import LABEL_AUTHENTIK_GENERATED from authentik.blueprints.v1.labels import LABEL_AUTHENTIK_GENERATED
from authentik.flows.models import Flow, FlowStageBinding, Stage from authentik.flows.models import Flow, FlowStageBinding, Stage
from authentik.lib.models import SerializerModel
from authentik.policies.models import Policy, PolicyBinding from authentik.policies.models import Policy, PolicyBinding
from authentik.stages.prompt.models import PromptStage from authentik.stages.prompt.models import PromptStage
@ -36,6 +37,8 @@ class Exporter:
continue continue
if model in self.excluded_models: if model in self.excluded_models:
continue continue
if SerializerModel not in model.__mro__:
continue
for obj in model.objects.all(): for obj in model.objects.all():
yield BlueprintEntry.from_model(obj) yield BlueprintEntry.from_model(obj)