From f0e24677a8e3d0a1b42d6c787c21d06c64bcc964 Mon Sep 17 00:00:00 2001 From: "Jens L." Date: Wed, 24 Jul 2024 20:39:19 +0200 Subject: [PATCH] lifecycle: only create tenant media root if needed (#10616) --- lifecycle/system_migrations/tenant_files.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lifecycle/system_migrations/tenant_files.py b/lifecycle/system_migrations/tenant_files.py index 40795d4607b6..737e1c0c1224 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" @@ -9,7 +10,9 @@ class Migration(BaseMigration): def needs_migration(self) -> bool: - return not TENANT_MEDIA_ROOT.exists() + return ( + not TENANT_MEDIA_ROOT.exists() and CONFIG.get("storage.media.backend", "file") != "s3" + ) def run(self): TENANT_MEDIA_ROOT.mkdir(parents=True)