handling error reporting

This commit is contained in:
Khalim Conn-Kowlessar 2024-06-04 10:08:07 +01:00
parent 813d51e9f3
commit bc5008bdd5
2 changed files with 6 additions and 5 deletions

View file

@ -203,11 +203,11 @@ class Property:
# difference_record = self.epc_record - self.epc_record
# TODO: change these lower and replace in the settings file
print(
"CHANGE THE LATEST FIELD TO REMOVE NUMBER HABITABLE ROOMS IF WE WANT TO USE STARTING/ENDING"
)
# print(
# "CHANGE THE LATEST FIELD TO REMOVE NUMBER HABITABLE ROOMS IF WE WANT TO USE STARTING/ENDING"
# )
fixed_data_col_names = MANDATORY_FIXED_FEATURES + LATEST_FIELD
print("NEED TO CHANGE THE DASH TO LOWER CASE")
# print("NEED TO CHANGE THE DASH TO LOWER CASE")
fixed_data_col_names = [
x.lower().replace("_", "-") for x in fixed_data_col_names
]

View file

@ -750,7 +750,8 @@ async def build_mds(body: MdsRequest):
mds = Mds(property_instance=p, materials=materials, optimise_measures=optimise_measures)
mds_recommendations, property_representative_recommendations, errors = mds.build()
if errors:
if any([len(x) for x in errors.values()]):
blah
logger.info("Errors occurred during MDS build")
recommendations[p.id] = mds_recommendations