Skip to content

Commit 2f8f854

Browse files
committed
Precommit fixes
1 parent 199ac6b commit 2f8f854

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

main/settings.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,17 +57,16 @@
5757

5858
# Validate environment configuration on startup
5959
# Skip validation during testing or when explicitly disabled
60-
if not get_bool("SKIP_ENV_VALIDATION", False) and "test" not in os.environ.get(
60+
if not get_bool("SKIP_ENV_VALIDATION", default=False) and "test" not in os.environ.get(
6161
"DJANGO_SETTINGS_MODULE", ""
6262
):
6363
try:
6464
from main.env_validator import validate_environment_on_startup
6565

6666
validate_environment_on_startup()
67-
except ImportError as e:
68-
log.warning(f"Could not import environment validator: {e}")
69-
except Exception as e:
70-
log.warning(f"Environment validation failed: {e}")
67+
except Exception as e: # noqa: BLE001
68+
# We don't want to block if validation fails.
69+
log.warning("Environment validation failed: %s", e)
7170

7271
BASE_DIR = os.path.dirname( # noqa: PTH120
7372
os.path.dirname(os.path.abspath(__file__)) # noqa: PTH100, PTH120

0 commit comments

Comments
 (0)