From be7502b2c29d11e1590a87e505b0f55a683ba328 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Wed, 24 Jul 2024 15:00:58 +0200 Subject: [PATCH] t Signed-off-by: Jens Langhammer --- lifecycle/system_migrations/tenant_files.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lifecycle/system_migrations/tenant_files.py b/lifecycle/system_migrations/tenant_files.py index 40795d4607b6a..d9579ac96fb7c 100644 --- a/lifecycle/system_migrations/tenant_files.py +++ b/lifecycle/system_migrations/tenant_files.py @@ -1,6 +1,7 @@ # flake8: noqa from pathlib import Path +from authentik.lib.config import CONFIG from lifecycle.migrate import BaseMigration MEDIA_ROOT = Path(__file__).parent.parent.parent / "media" @@ -12,6 +13,8 @@ def needs_migration(self) -> bool: return not TENANT_MEDIA_ROOT.exists() def run(self): + if CONFIG.get("storage.media.backend", "file") == "s3": + return TENANT_MEDIA_ROOT.mkdir(parents=True) for d in ("application-icons", "source-icons", "flow-backgrounds"): if (MEDIA_ROOT / d).exists():