Fix linter errors

This commit is contained in:
Seamus Johnston 2022-08-26 13:25:22 -05:00
parent 4ace5b4128
commit e04a19b292
No known key found for this signature in database
GPG key ID: 2F21225985069105

View file

@ -28,7 +28,7 @@ env = environs.Env()
# Get secrets from Cloud.gov user provided service, if exists # Get secrets from Cloud.gov user provided service, if exists
# If not, get secrets from environment variables # If not, get secrets from environment variables
key_service = AppEnv().get_service(name='getgov-credentials') key_service = AppEnv().get_service(name="getgov-credentials")
if key_service and key_service.credentials: if key_service and key_service.credentials:
secret = key_service.credentials.get secret = key_service.credentials.get
else: else:
@ -64,7 +64,6 @@ INSTALLED_APPS = [
# from database models to provide a quick, model-centric # from database models to provide a quick, model-centric
# interface where trusted users can manage content # interface where trusted users can manage content
"django.contrib.admin", "django.contrib.admin",
# vv Required by django.contrib.admin vv # vv Required by django.contrib.admin vv
# the "user" model! *\o/* # the "user" model! *\o/*
"django.contrib.auth", "django.contrib.auth",
@ -75,7 +74,6 @@ INSTALLED_APPS = [
# framework for displaying messages to the user # framework for displaying messages to the user
"django.contrib.messages", "django.contrib.messages",
# ^^ Required by django.contrib.admin ^^ # ^^ Required by django.contrib.admin ^^
# collects static files from each of your applications # collects static files from each of your applications
# (and any other places you specify) into a single location # (and any other places you specify) into a single location
# that can easily be served in production # that can easily be served in production
@ -88,29 +86,21 @@ INSTALLED_APPS = [
MIDDLEWARE = [ MIDDLEWARE = [
# django-allow-cidr: enable use of CIDR IP ranges in ALLOWED_HOSTS # django-allow-cidr: enable use of CIDR IP ranges in ALLOWED_HOSTS
"allow_cidr.middleware.AllowCIDRMiddleware", "allow_cidr.middleware.AllowCIDRMiddleware",
# provide security enhancements to the request/response cycle # provide security enhancements to the request/response cycle
"django.middleware.security.SecurityMiddleware", "django.middleware.security.SecurityMiddleware",
# store and retrieve arbitrary data on a per-site-visitor basis # store and retrieve arbitrary data on a per-site-visitor basis
"django.contrib.sessions.middleware.SessionMiddleware", "django.contrib.sessions.middleware.SessionMiddleware",
# add a few conveniences for perfectionists, see documentation # add a few conveniences for perfectionists, see documentation
"django.middleware.common.CommonMiddleware", "django.middleware.common.CommonMiddleware",
# add protection against Cross Site Request Forgeries by adding # add protection against Cross Site Request Forgeries by adding
# hidden form fields to POST forms and checking requests for the correct value # hidden form fields to POST forms and checking requests for the correct value
"django.middleware.csrf.CsrfViewMiddleware", "django.middleware.csrf.CsrfViewMiddleware",
# add `user` (the currently-logged-in user) to incoming HttpRequest objects # add `user` (the currently-logged-in user) to incoming HttpRequest objects
"django.contrib.auth.middleware.AuthenticationMiddleware", "django.contrib.auth.middleware.AuthenticationMiddleware",
# provide framework for displaying messages to the user, see documentation # provide framework for displaying messages to the user, see documentation
"django.contrib.messages.middleware.MessageMiddleware", "django.contrib.messages.middleware.MessageMiddleware",
# provide clickjacking protection via the X-Frame-Options header # provide clickjacking protection via the X-Frame-Options header
"django.middleware.clickjacking.XFrameOptionsMiddleware", "django.middleware.clickjacking.XFrameOptionsMiddleware",
# django-csp: enable use of Content-Security-Policy header # django-csp: enable use of Content-Security-Policy header
"csp.middleware.CSPMiddleware", "csp.middleware.CSPMiddleware",
] ]
@ -221,7 +211,8 @@ SERVER_EMAIL = "root@get.gov"
# Content-Length header is set by django.middleware.common.CommonMiddleware # Content-Length header is set by django.middleware.common.CommonMiddleware
# X-Frame-Options header is set by django.middleware.clickjacking.XFrameOptionsMiddleware # X-Frame-Options header is set by
# django.middleware.clickjacking.XFrameOptionsMiddleware
# and configured in the Security and Privacy section of this file. # and configured in the Security and Privacy section of this file.
# Strict-Transport-Security is set by django.middleware.security.SecurityMiddleware # Strict-Transport-Security is set by django.middleware.security.SecurityMiddleware
# and configured in the Security and Privacy section of this file. # and configured in the Security and Privacy section of this file.
@ -349,7 +340,7 @@ LOGGING = {
# endregion # endregion
# region: Routing-----------------------------------------------------------### # region: Routing-----------------------------------------------------------###
## Set by django.middleware.common.CommonMiddleware # ~ Set by django.middleware.common.CommonMiddleware
# APPEND_SLASH = True # APPEND_SLASH = True
# PREPEND_WWW = False # PREPEND_WWW = False
@ -367,16 +358,16 @@ STATIC_URL = "public/"
SECRET_KEY = secret_key SECRET_KEY = secret_key
# Use this variable for doing SECRET_KEY rotation, see documentation # Use this variable for doing SECRET_KEY rotation, see documentation
SECRET_KEY_FALLBACKS = [] SECRET_KEY_FALLBACKS: "list[str]" = []
## Set by django.middleware.security.SecurityMiddleware # ~ Set by django.middleware.security.SecurityMiddleware
# SECURE_CONTENT_TYPE_NOSNIFF = True # SECURE_CONTENT_TYPE_NOSNIFF = True
# SECURE_CROSS_ORIGIN_OPENER_POLICY = "same-origin" # SECURE_CROSS_ORIGIN_OPENER_POLICY = "same-origin"
# SECURE_REDIRECT_EXEMPT = [] # SECURE_REDIRECT_EXEMPT = []
# SECURE_REFERRER_POLICY = "same-origin" # SECURE_REFERRER_POLICY = "same-origin"
# SECURE_SSL_HOST = None # SECURE_SSL_HOST = None
## Overridden from django.middleware.security.SecurityMiddleware # ~ Overridden from django.middleware.security.SecurityMiddleware
# adds the includeSubDomains directive to the HTTP Strict Transport Security header # adds the includeSubDomains directive to the HTTP Strict Transport Security header
SECURE_HSTS_INCLUDE_SUBDOMAINS = True SECURE_HSTS_INCLUDE_SUBDOMAINS = True
# adds the preload directive to the HTTP Strict Transport Security header # adds the preload directive to the HTTP Strict Transport Security header
@ -386,7 +377,7 @@ SECURE_HSTS_SECONDS = 300
# redirect all non-HTTPS requests to HTTPS # redirect all non-HTTPS requests to HTTPS
SECURE_SSL_REDIRECT = True SECURE_SSL_REDIRECT = True
## Set by django.middleware.common.CommonMiddleware # ~ Set by django.middleware.common.CommonMiddleware
# DISALLOWED_USER_AGENTS = [] # DISALLOWED_USER_AGENTS = []
# The host/domain names that Django can serve. # The host/domain names that Django can serve.
@ -404,7 +395,7 @@ ALLOWED_HOSTS = [
# load balancers for health checks, etc. # load balancers for health checks, etc.
ALLOWED_CIDR_NETS = ["10.0.0.0/8"] ALLOWED_CIDR_NETS = ["10.0.0.0/8"]
## Below are some protections from cross-site request forgery. # ~ Below are some protections from cross-site request forgery.
# This is canonically done by including a nonce value # This is canonically done by including a nonce value
# in pages sent to the user, which the user is expected # in pages sent to the user, which the user is expected
# to send back. The specifics of implementation are # to send back. The specifics of implementation are
@ -466,7 +457,7 @@ SESSION_COOKIE_SAMESITE = "Strict"
# instruct browser to only send cookie via HTTPS # instruct browser to only send cookie via HTTPS
SESSION_COOKIE_SECURE = True SESSION_COOKIE_SECURE = True
## Set by django.middleware.clickjacking.XFrameOptionsMiddleware # ~ Set by django.middleware.clickjacking.XFrameOptionsMiddleware
# prevent clickjacking by instructing the browser not to load # prevent clickjacking by instructing the browser not to load
# our site within an iframe # our site within an iframe
# X_FRAME_OPTIONS = "Deny" # X_FRAME_OPTIONS = "Deny"
@ -477,7 +468,7 @@ SESSION_COOKIE_SECURE = True
# Additional directories searched for fixture files. # Additional directories searched for fixture files.
# The fixtures directory of each application is searched by default. # The fixtures directory of each application is searched by default.
# Must use unix style "/" path separators. # Must use unix style "/" path separators.
FIXTURE_DIRS = [] FIXTURE_DIRS: "list[str]" = []
# endregion # endregion