Skip to content

Commit

Permalink
Ignore asset-related configuration unless environment is development.
Browse files Browse the repository at this point in the history
  • Loading branch information
toddbirchard committed Dec 16, 2023
1 parent f98c205 commit b07cf96
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions config.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,14 @@ class Config:
COMPRESSOR_DEBUG = False

# Flask-Assets
LESS_BIN = system("which lessc")
ASSETS_DEBUG = False
LESS_RUN_IN_DEBUG = False
if ENVIRONMENT == "development" and LESS_BIN is None:
raise ValueError("Application running in `development` mode cannot create assets without `lessc` installed.")
if ENVIRONMENT == "development":
LESS_BIN = system("which lessc")
ASSETS_DEBUG = False
LESS_RUN_IN_DEBUG = False
if LESS_BIN is None:
raise ValueError(
"Application running in `development` mode cannot create assets without `lessc` installed."
)

# Hardcoded data
PRODUCT_DATA_FILEPATH = f"{BASE_DIR}/data/products.json"

0 comments on commit b07cf96

Please sign in to comment.