Skip to content

Commit

Permalink
Fix ruff checks
Browse files Browse the repository at this point in the history
  • Loading branch information
WillGibson committed Sep 25, 2023
1 parent de35afb commit 277525f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 25 deletions.
13 changes: 5 additions & 8 deletions src/config/settings/base_after_django_environ.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import os

import dj_database_url
import environ
import sentry_sdk
Expand All @@ -12,8 +10,8 @@

# Read environment variables using `django-environ`, use `.env` if it exists
env = environ.Env()
env_file = os.path.join(PROJECT_ROOT_DIR, ".env")
if os.path.exists(env_file):
env_file = os.path.join(PROJECT_ROOT_DIR, ".env") # noqa F405
if os.path.exists(env_file): # noqa F405
env.read_env(env_file)
env.read_env()

Expand Down Expand Up @@ -81,7 +79,7 @@
if "postgres" in VCAP_SERVICES:
DATABASE_URL = VCAP_SERVICES["postgres"][0]["credentials"]["uri"]
else:
DATABASE_URL = os.getenv("DATABASE_URL")
DATABASE_URL = os.getenv("DATABASE_URL") # noqa F405

DATABASES = {
"default": env.db(),
Expand All @@ -93,7 +91,7 @@
WEBPACK_LOADER = {
"DEFAULT": {
"CACHE": not DEBUG,
"STATS_FILE": os.path.join(PROJECT_ROOT_DIR, "webpack-stats.json"),
"STATS_FILE": os.path.join(PROJECT_ROOT_DIR, "webpack-stats.json"), # noqa F405
"POLL_INTERVAL": 0.1,
"IGNORE": [r".+\.hot-update.js", r".+\.map"],
}
Expand All @@ -110,8 +108,7 @@
},
}

WAGTAILSEARCH_BACKENDS.default.URLS = ([OPENSEARCH_URL],)

WAGTAILSEARCH_BACKENDS.default.URLS = ([OPENSEARCH_URL],) # noqa F405

# ClamAV
CLAM_AV_USERNAME = env("CLAM_AV_USERNAME", default=None)
Expand Down
23 changes: 7 additions & 16 deletions src/config/settings/build.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,17 @@
from .base import * # noqa

VALUE_DOES_NOT_MATTER_FOR_BUILD_STRING = "value-does-not-matter-for-build"

APP_ENV = "build"

SECRET_KEY = "value-does-not-matter-for-build"
SECRET_KEY = VALUE_DOES_NOT_MATTER_FOR_BUILD_STRING

ELASTICSEARCH_DSL = {
"default": {
"hosts": "value-does-not-matter-for-build",
"hosts": VALUE_DOES_NOT_MATTER_FOR_BUILD_STRING,
},
}

CLAM_AV_USERNAME = "value-does-not-matter-for-build"
CLAM_AV_PASSWORD = "value-does-not-matter-for-build"
CLAM_AV_DOMAIN = "value-does-not-matter-for-build"

DATABASES = {
"default": {
"username": "value-does-not-matter-for-build",
"password": "value-does-not-matter-for-build",
"dbname": "value-does-not-matter-for-build",
"engine": "postgres",
"port": 5432,
"host": "localhost",
}
}
CLAM_AV_USERNAME = VALUE_DOES_NOT_MATTER_FOR_BUILD_STRING
CLAM_AV_PASSWORD = VALUE_DOES_NOT_MATTER_FOR_BUILD_STRING
CLAM_AV_DOMAIN = VALUE_DOES_NOT_MATTER_FOR_BUILD_STRING
1 change: 0 additions & 1 deletion src/config/settings/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

from .base_after_django_environ import * # noqa


AWS_S3_URL_PROTOCOL = "https:"
AWS_S3_CUSTOM_DOMAIN = env("AWS_S3_CUSTOM_DOMAIN") # noqa F405
AWS_QUERYSTRING_AUTH = False
Expand Down

0 comments on commit 277525f

Please sign in to comment.