From e994a01e80345fdd8dab32de1c9f6ad5939f3c95 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Tue, 23 Aug 2022 20:54:56 +0200 Subject: [PATCH] blueprints: handle blueprints without metadata Signed-off-by: Jens Langhammer --- authentik/blueprints/v1/tasks.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/authentik/blueprints/v1/tasks.py b/authentik/blueprints/v1/tasks.py index f685d7ef7..2cf355a0d 100644 --- a/authentik/blueprints/v1/tasks.py +++ b/authentik/blueprints/v1/tasks.py @@ -170,5 +170,6 @@ def apply_blueprint(self: MonitoredTask, instance_pk: str): instance.status = BlueprintInstanceStatus.ERROR self.set_status(TaskResult(TaskResultStatus.ERROR).with_error(exc)) finally: - instance.metadata = asdict(importer.blueprint.metadata) + if importer.blueprint.metadata: + instance.metadata = asdict(importer.blueprint.metadata) instance.save()