diff --git a/src/calculation_time_constrains/flows.py b/src/calculation_time_constrains/flows.py index 6ccf738..fcc8b68 100644 --- a/src/calculation_time_constrains/flows.py +++ b/src/calculation_time_constrains/flows.py @@ -22,10 +22,10 @@ async def get_create_calculation_parameters(*, db_session: DbSession): results = await db_session.execute(stmt) costFailure = results.all() - - avaiableScopes = {scope.id: scope.scope_name for scope in await get_all(db_session=db_session)} + scopes = await get_all(db_session=db_session) + avaiableScopes = {scope.id: scope.scope_name for scope in scopes} costFailurePerScope = {avaiableScopes.get( - costPerFailure[0]): costPerFailure[1] for costPerFailure in await costFailure} + costPerFailure[0]): costPerFailure[1] for costPerFailure in costFailure} return CalculationTimeConstrainsParametersRead( costPerFailure=costFailurePerScope,