Skip to content

Commit

Permalink
fix: logging message when still using flask_env
Browse files Browse the repository at this point in the history
Signed-off-by: GustaafL <guus@seita.nl>
  • Loading branch information
GustaafL committed Dec 19, 2023
1 parent cd9d9a8 commit ec461c6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions flexmeasures/utils/config_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,18 +74,18 @@ def read_config(app: Flask, custom_path_to_config: str | None):

flexmeasures_env = DefaultConfig.FLEXMEASURES_ENV_DEFAULT
if app.testing:
print("A")
flexmeasures_env = "testing"
elif os.getenv("FLEXMEASURES_ENV", None):
print("B")
flexmeasures_env = os.getenv("FLEXMEASURES_ENV", None)
elif os.getenv("FLASK_ENV", None):
print("are we getting to this point")
flexmeasures_env = os.getenv("FLASK_ENV", None)
import warnings

warnings.warn(
app.logger.warning(
"'FLASK_ENV' is deprecated and replaced by FLEXMEASURES_ENV"
" Change FLASK_ENV to FLEXMEASURES_ENV in the environment variables",
DeprecationWarning,
stacklevel=2,
)

check_app_env(flexmeasures_env)
Expand Down

0 comments on commit ec461c6

Please sign in to comment.