mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
modifying the handling of non-intrusive frecommendations as strings
This commit is contained in:
parent
d25bbab716
commit
fd2600b9ba
2 changed files with 3 additions and 6 deletions
|
|
@ -107,10 +107,7 @@ class Property:
|
|||
# cost and instead, provide a message that the measure has already been installed
|
||||
|
||||
self.already_installed = ast.literal_eval(already_installed['already_installed']) if already_installed else []
|
||||
self.non_invasive_recommendations = (
|
||||
ast.literal_eval(non_invasive_recommendations['recommendations']) if
|
||||
non_invasive_recommendations else []
|
||||
)
|
||||
self.non_invasive_recommendations = non_invasive_recommendations
|
||||
# This is a list of measures that have been recommended for the property
|
||||
if isinstance(measures, list):
|
||||
self.measures = measures
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import ast
|
||||
import json
|
||||
from datetime import datetime
|
||||
|
||||
|
|
@ -358,7 +359,6 @@ def extract_property_request_data(
|
|||
), {})
|
||||
|
||||
if isinstance(property_non_invasive_recommendations.get("recommendations"), str):
|
||||
import ast
|
||||
property_non_invasive_recommendations["recommendations"] = ast.literal_eval(
|
||||
property_non_invasive_recommendations["recommendations"]
|
||||
)
|
||||
|
|
@ -369,7 +369,7 @@ def extract_property_request_data(
|
|||
else:
|
||||
transformed.append(rec)
|
||||
|
||||
property_non_invasive_recommendations["recommendations"] = str(transformed)
|
||||
property_non_invasive_recommendations["recommendations"] = transformed
|
||||
|
||||
# Check if the valuation data has uprn
|
||||
valuation_has_uprn = "uprn" in valuation_data[0] if valuation_data else False
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue