diff --git a/backend/app/plan/router.py b/backend/app/plan/router.py index e28b4d27..099d0827 100644 --- a/backend/app/plan/router.py +++ b/backend/app/plan/router.py @@ -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)