diff --git a/documentation/changelog.rst b/documentation/changelog.rst index 5ba2163859..977ae9fa7b 100644 --- a/documentation/changelog.rst +++ b/documentation/changelog.rst @@ -29,6 +29,7 @@ Bugfixes * Fix forecasting regressor filtering to use only regressor beliefs known at the forecast ``belief_time`` [see `PR #2134 `_] * Check read permissions for sensors referenced in forecasting and scheduling config payloads, and return a clearer 403 error when a referenced sensor is not readable [see `PR #2096 `_ and `PR #2125 `_] * Standardize resolution formatting across API endpoints for consistent response payloads [see `PR #2152 `_] +* Make the auth check for CLI commands work with ``flask``, too, instead of only with the ``flexmeasures`` alias [see `PR #2169 `_] v0.32.2 | May 12, 2026 diff --git a/flexmeasures/cli/__init__.py b/flexmeasures/cli/__init__.py index 09c246f81e..9d17ef3d33 100644 --- a/flexmeasures/cli/__init__.py +++ b/flexmeasures/cli/__init__.py @@ -37,7 +37,10 @@ def is_running() -> bool: cli_sets = current_app.cli.list_commands(ctx=None) command_line = " ".join(sys.argv) for cli_set in cli_sets: - if f"flexmeasures {cli_set}" in command_line: + if ( + f"flexmeasures {cli_set}" in command_line + or f"flask {cli_set}" in command_line + ): return True if current_app.config.get("PRETEND_RUNNING_AS_CLI", False): return True