From af7cc8d42d4349b5f1460e87fe798e7f984f9c39 Mon Sep 17 00:00:00 2001 From: Jens L Date: Fri, 28 Apr 2023 22:44:19 +0300 Subject: [PATCH] blueprints: fix error when imported blueprint is invalid (#5414) Signed-off-by: Jens Langhammer --- authentik/blueprints/api.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/authentik/blueprints/api.py b/authentik/blueprints/api.py index 2e2f02663..8f8b7f06b 100644 --- a/authentik/blueprints/api.py +++ b/authentik/blueprints/api.py @@ -49,7 +49,8 @@ class BlueprintInstanceSerializer(ModelSerializer): context = self.instance.context if self.instance else {} valid, logs = Importer(content, context).validate() if not valid: - raise ValidationError(_("Failed to validate blueprint"), *[x["msg"] for x in logs]) + text_logs = "\n".join([x["event"] for x in logs]) + raise ValidationError(_("Failed to validate blueprint: %(logs)s" % {"logs": text_logs})) return content def validate(self, attrs: dict) -> dict: