Skip to content

Commit

Permalink
Add to SILENCED_SYSTEM_CHECKS from environment
Browse files Browse the repository at this point in the history
Allow the environment to silence more system checks, used by dockerflow
for __heartbeat__. Ensure "models.W040" is included, even if not
specified.
  • Loading branch information
jwhitlock committed Apr 16, 2024
1 parent 4209c53 commit 061f177
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions privaterelay/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -456,11 +456,14 @@ def _get_initial_middleware() -> list[str]:
if TEST_DB_NAME:
DATABASES["default"]["TEST"] = {"NAME": TEST_DB_NAME}

SILENCED_SYSTEM_CHECKS = [
# (models.W040) SQLite does not support indexes with non-key columns.
# RelayAddress index idx_ra_created_by_addon uses this for PostgreSQL.
"models.W040",
]
SILENCED_SYSTEM_CHECKS = sorted(
set(config("DJANGO_SILENCED_SYSTEM_CHECKS", default="", cast=Csv()))
| {
# (models.W040) SQLite does not support indexes with non-key columns.
# RelayAddress index idx_ra_created_by_addon uses this for PostgreSQL.
"models.W040",
}
)

REDIS_URL = config("REDIS_URL", "")
if REDIS_URL:
Expand Down

0 comments on commit 061f177

Please sign in to comment.