Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix asset display when asset has no owner #514

Merged
merged 2 commits into from Oct 13, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions flexmeasures/data/services/sensors.py
Expand Up @@ -7,7 +7,7 @@


def get_sensors(
account: Account | list[Account],
account: Account | list[Account] | None,
include_public_assets: bool = False,
sensor_id_allowlist: list[int] | None = None,
sensor_name_allowlist: list[str] | None = None,
Expand All @@ -20,7 +20,9 @@ def get_sensors(
:param sensor_name_allowlist: optionally, allow only sensors whose name is in this list
"""
sensor_query = Sensor.query
if isinstance(account, list):
if account is None:
account_ids = []
elif isinstance(account, list):
account_ids = [account.id for account in account]
else:
account_ids = [account.id]
Expand Down