diff --git a/backend/Property.py b/backend/Property.py index 649a9547..f8b40872 100644 --- a/backend/Property.py +++ b/backend/Property.py @@ -93,7 +93,7 @@ class Property: self.data = { k.replace("_", "-"): v for k, v in epc_record.get("prepared_epc").items() } - + self.old_data = epc_record.get("old_data") self.property_dimensions = None # This is a list of measures that have already been installed in the property, typically found as a result @@ -1181,6 +1181,14 @@ class Property: self.heating_energy_source = list({ fuel for key, fuel in heating_fuel_mapping.items() if self.main_heating.get(key, False) }) + + if set(self.heating_energy_source) == {'Electricity', 'Natural Gas'}: + # It means they have mixed heating so we take the primary one, based on main fuel + if self.main_fuel["clean_description"] == "Mains gas not community": + self.heating_energy_source = ['Natural Gas'] + else: + self.heating_energy_source = ['Electricity'] + if len(self.heating_energy_source) == 0 or len(self.heating_energy_source) > 1: raise Exception("Investigate me")