From db52e2a065b3c4fe69ea32ec434d10243c56d0b2 Mon Sep 17 00:00:00 2001 From: baseplate-admin <61817579+baseplate-admin@users.noreply.github.com> Date: Thu, 22 Feb 2024 22:07:32 +0600 Subject: [PATCH] Fix multiple database problem (#5) --- django_ltree/checks.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/django_ltree/checks.py b/django_ltree/checks.py index a6df53f..f7af5d1 100644 --- a/django_ltree/checks.py +++ b/django_ltree/checks.py @@ -8,7 +8,9 @@ def check_database_backend_is_postgres(app_configs, **kwargs): errors = [] valid_dbs = ["postgres", "postgis"] - if not any(d in settings.DATABASES["default"]["ENGINE"] for d in valid_dbs): + if "default" in settings.DATABASES and all( + d not in settings.DATABASES["default"]["ENGINE"] for d in valid_dbs + ): errors.append( Warning( "django_ltree needs postgres to support install the ltree extension.",