mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
fixing bug when setting phase for heating controls, without a recommendation
This commit is contained in:
parent
5079170a25
commit
5ac5cd7737
2 changed files with 6 additions and 11 deletions
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue