Skip to content

Commit

Permalink
upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
peterdudfield committed Oct 23, 2024
1 parent d7ce357 commit 7ba5704
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions ruvnl_consumer_app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,16 @@ def get_sites(db_session: Session) -> list[SiteSQL]:
valid_sites = []
for asset_type in ["pv", "wind"]:

valid_sites = [s for s in sites if s.asset_type.name == asset_type]
if len(valid_sites) == 0:
sites = [s for s in sites if s.asset_type.name == asset_type]
if len(sites) == 0:
log.warning(f"Could not find site for asset type: {asset_type}")

# only select sites with region equal ruvnl
valid_sites = [site for site in valid_sites if site.region == "ruvnl"]
sites = [site for site in sites if site.region == "ruvnl"]

assert len(sites) == 0, "No sites found for ruvnl region"

valid_sites.append(sites[0])

return valid_sites

Expand Down

0 comments on commit 7ba5704

Please sign in to comment.