Skip to content

Commit

Permalink
fix query limiting based on accounts for when CLI is used (#407)
Browse files Browse the repository at this point in the history
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
  • Loading branch information
nhoening committed Mar 29, 2022
1 parent a7d74c0 commit 8485f5f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion flexmeasures/data/queries/utils.py
Expand Up @@ -49,7 +49,7 @@ def potentially_limit_query_to_account_assets(
:param account_id: if set, all assets that are not in the given account will be filtered out (only works for admins and CLI users). For querying public assets in particular, don't use this function.
"""
if not current_user.is_authenticated and not current_app.cli:
if not current_app.cli and not current_user.is_authenticated:
raise Forbidden("Unauthenticated user cannot list assets.")
user_is_admin = (
current_app.cli
Expand Down

0 comments on commit 8485f5f

Please sign in to comment.