Skip to content

Commit

Permalink
Backport PR #407: fix query limiting based on accounts for when CLI i…
Browse files Browse the repository at this point in the history
…s used (#407)

Signed-off-by: Nicolas Höning <nicolas@seita.nl>
  • Loading branch information
nhoening authored and Flix6x committed Mar 30, 2022
1 parent c35409b commit f3954d6
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 f3954d6

Please sign in to comment.