diff --git a/src/calculation_time_constrains/service.py b/src/calculation_time_constrains/service.py index 32a7510..a44bf76 100644 --- a/src/calculation_time_constrains/service.py +++ b/src/calculation_time_constrains/service.py @@ -2119,7 +2119,7 @@ async def bulk_update_equipment( case_mappings = {asset.location_tag: asset.is_included for asset in selected_equipments} # Get all assetnums that need to be updated - assetnums = list(case_mappings.keys()) + location_tags = list(case_mappings.keys()) # Create a list of when clauses for the case statement when_clauses = [ @@ -2131,7 +2131,7 @@ async def bulk_update_equipment( stmt = ( update(CalculationEquipmentResult) .where(CalculationEquipmentResult.calculation_data_id == calculation_data_id) - .where(CalculationEquipmentResult.assetnum.in_(assetnums)) + .where(CalculationEquipmentResult.location_tag.in_(location_tags)) .values( { "is_included": case( @@ -2144,4 +2144,4 @@ async def bulk_update_equipment( await db.execute(stmt) await db.commit() - return assetnums + return location_tags