refactor: use global IS_DOCKER_SETUP setting

This commit is contained in:
jo 2023-04-08 18:31:55 +02:00
parent 58ffbc2156
commit e4793f06e8
No known key found for this signature in database
GPG Key ID: B2FEC9B22722B984
1 changed files with 2 additions and 1 deletions

View File

@ -14,6 +14,7 @@ APPS_DIR = ROOT_DIR.path("funkwhale_api")
env = environ.Env()
ENV = env
LOGLEVEL = env("LOGLEVEL", default="info").upper()
IS_DOCKER_SETUP = env.bool("IS_DOCKER_SETUP", False)
if env("FUNKWHALE_SENTRY_DSN", default=None) is not None:
@ -374,7 +375,7 @@ vars().update(EMAIL_CONFIG)
# The `_database_url_docker` variable will only by used as default for DATABASE_URL
# in the context of a docker deployment.
_database_url_docker = None
if env.bool("IS_DOCKER_SETUP", False) and env.str("DATABASE_URL", None) is None:
if IS_DOCKER_SETUP and env.str("DATABASE_URL", None) is None:
warnings.warn(
DeprecationWarning(
"the automatically generated 'DATABASE_URL' configuration in the docker "