diff --git a/backend/Property.py b/backend/Property.py index 956dd586..580dbb89 100644 --- a/backend/Property.py +++ b/backend/Property.py @@ -350,7 +350,19 @@ class Property: r for r in property_representative_recommendations if r["phase"] <= phase ] - epc_transformations = [x["description_simulation"] for x in represenative_recs_to_this_phase] + # TODO: This is placeholder, but it's to handle the case of having both internal and external wall + # insulation as options. This will cause the process below to fall over, so we take just + # external wall insulation in epc_transformations, if we have both + types = [ + x["type"] for x in represenative_recs_to_this_phase + ] + if "external_wall_insulation" in types and "internal_wall_insulation" in types: + epc_transformations = [ + x["description_simulation"] for x in represenative_recs_to_this_phase if + x["type"] != "internal_wall_insulation" + ] + else: + epc_transformations = [x["description_simulation"] for x in represenative_recs_to_this_phase] # It is possible that we could have two simulations applied to the same descriptions # We extract these out