Skip to content

Commit

Permalink
fix: while fetching cluster, versions for site plan consider only act…
Browse files Browse the repository at this point in the history
…ive bench
  • Loading branch information
tanmoysrt committed Jul 16, 2024
1 parent 9ae1043 commit c62e834
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions press/api/site.py
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,7 @@ def get_site_plans():
.on(Bench.group == plan_details_query.release_group)
.left_join(ReleaseGroup)
.on(ReleaseGroup.name == plan_details_query.release_group)
.where(Bench.status == "Active")
)

plan_details = plan_details_with_bench_query.run(as_dict=True)
Expand Down Expand Up @@ -786,9 +787,14 @@ def get_site_plans():
and plan_details_dict[plan.name]["release_groups"]
):
continue
plan.clusters = plan_details_dict[plan.name]["clusters"]
plan.allowed_apps = plan_details_dict[plan.name]["allowed_apps"]
plan.bench_versions = plan_details_dict[plan.name]["bench_versions"]
if plan.name in plan_details_dict:
plan.clusters = plan_details_dict[plan.name]["clusters"]
plan.allowed_apps = plan_details_dict[plan.name]["allowed_apps"]
plan.bench_versions = plan_details_dict[plan.name]["bench_versions"]
else:
plan.clusters = []
plan.allowed_apps = []
plan.bench_versions = []
filtered_plans.append(plan)

return filtered_plans
Expand Down

0 comments on commit c62e834

Please sign in to comment.