diff --git a/backend/Property.py b/backend/Property.py index 6148b40a..cbc762e6 100644 --- a/backend/Property.py +++ b/backend/Property.py @@ -1212,9 +1212,17 @@ class Property: else: self.heating_energy_source = ['Wood Logs'] - if len(self.heating_energy_source) == 0 or len(self.heating_energy_source) > 1: + if len(self.heating_energy_source) == 0 or ( + len(self.heating_energy_source) > 1 and "Varied (Community Scheme)" not in self.heating_energy_source + ): + # We might have something like heating energy source equal to ['Natural Gas', 'Varied (Community Scheme)'] + # so we treat this as community heating raise Exception("Investigate me") + if len(self.heating_energy_source) > 1: + # We treat this as a community scheme + self.heating_energy_source = ["Varied (Community Scheme)"] + self.heating_energy_source = self.heating_energy_source[0] if self.heating_energy_source == "Varied (Community Scheme)": diff --git a/etl/epc/Record.py b/etl/epc/Record.py index c1c3ff67..e1853361 100644 --- a/etl/epc/Record.py +++ b/etl/epc/Record.py @@ -596,6 +596,9 @@ class EPCRecord: if not self.prepared_epc: raise ValueError("EPC Recrod doesn not contain epc data") + if self.prepared_epc["total-floor-area"] is None: + return + self.prepared_epc["total-floor-area"] = float( self.prepared_epc["total-floor-area"] )