Adding back storage of property details epc

This commit is contained in:
Khalim Conn-Kowlessar 2024-07-30 11:37:02 +01:00
parent d4d9b8e518
commit c948c24061

View file

@ -734,15 +734,11 @@ async def trigger_plan(body: PlanTriggerRequest):
valuations = PropertyValuation.estimate(property_instance=p, target_epc=new_epc)
property_value_increase_ranges[p.id] = valuations
# Your existing operations
# If we have an energy assessment, which is more recent than the EPC, we don't need to store
# the EPC details in the database
if not p.energy_assessment_is_newer:
property_details_epc = p.get_property_details_epc(
portfolio_id=body.portfolio_id, rating_lookup=rating_lookup,
)
create_property_details_epc(session, property_details_epc)
property_details_epc = p.get_property_details_epc(
portfolio_id=body.portfolio_id, rating_lookup=rating_lookup,
)
create_property_details_epc(session, property_details_epc)
update_or_create_property_spatial_details(session, p.uprn, p.spatial)