From d3466ceef88de65ef920815a01a107babe6ee30b Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Sun, 28 Aug 2022 16:07:48 +0200 Subject: [PATCH] blueprints: use correct log level when re-logging import validation logs closes #3483 Signed-off-by: Jens Langhammer --- .../blueprints/management/commands/apply_blueprint.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/authentik/blueprints/management/commands/apply_blueprint.py b/authentik/blueprints/management/commands/apply_blueprint.py index e00e0e0a0..7b9081aae 100644 --- a/authentik/blueprints/management/commands/apply_blueprint.py +++ b/authentik/blueprints/management/commands/apply_blueprint.py @@ -1,4 +1,6 @@ """Apply blueprint from commandline""" +from sys import exit as sys_exit + from django.core.management.base import BaseCommand, no_translations from structlog.stdlib import get_logger @@ -20,8 +22,9 @@ class Command(BaseCommand): valid, logs = importer.validate() if not valid: for log in logs: - LOGGER.debug(**log) - raise ValueError("blueprint invalid") + getattr(LOGGER, log.pop("log_level"))(**log) + self.stderr.write("blueprint invalid") + sys_exit(1) importer.apply() def add_arguments(self, parser):