fixing bug when setting phase for heating controls, without a recommendation

This commit is contained in:
Khalim Conn-Kowlessar 2024-04-10 14:02:19 +01:00
parent 5079170a25
commit 5ac5cd7737
2 changed files with 6 additions and 11 deletions

View file

@ -142,16 +142,6 @@ async def trigger_plan(body: PlanTriggerRequest):
)
)
z = []
for p in input_properties:
z.append(
{
"uprn": p.uprn,
"address": p.address,
"postcode": p.postcode,
}
)
if not input_properties:
return Response(status_code=204)

View file

@ -361,7 +361,12 @@ class HeatingRecommender:
self.recommendations = combined_recommendations
else:
# We increment the recommendation phase, since the heating controls are separate from the boiler upgrade
recommendation_phase += 1
# but we'll only upgrade if we have a heating recommendation
has_heating_recommendation = any(
recommendation["type"] == "heating" for recommendation in self.recommendations
)
if has_heating_recommendation:
recommendation_phase += 1
# The heating controls recommendation is distrinct from the boiler upgrade recommendation
# We insert phase into the recommendations for heating controls
for recommendation in controls_recommender.recommendation: