Skip to content

Commit

Permalink
Merge pull request #15 from GreenDeploy-io/dont-check-when-no-databas…
Browse files Browse the repository at this point in the history
…e-is-set

♻️ REFACTOR check_database_backend_is_postgres
  • Loading branch information
mariocesar authored Dec 17, 2024
2 parents 154c7e3 + af56cd9 commit eb46a53
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion django_ltree/checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ 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 eb46a53

Please sign in to comment.