Skip to content

Commit

Permalink
Fix multiple database problem (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
baseplate-admin committed Feb 22, 2024
1 parent a1e2a78 commit db52e2a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion django_ltree/checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down

0 comments on commit db52e2a

Please sign in to comment.