File tree 4 files changed +16
-28
lines changed
4 files changed +16
-28
lines changed Original file line number Diff line number Diff line change @@ -36,10 +36,8 @@ async def get_rocketpy_environment_binary(
36
36
Raises:
37
37
HTTP 404 Not Found: If the env is not found in the database.
38
38
"""
39
- env_retrieved = await self .get_environment_by_id (env_id )
40
- env_service = EnvironmentService .from_env_model (
41
- env_retrieved .environment
42
- )
39
+ env = await self .get_environment_by_id (env_id )
40
+ env_service = EnvironmentService .from_env_model (env .environment )
43
41
return env_service .get_environment_binary ()
44
42
45
43
@controller_exception_handler
@@ -58,8 +56,6 @@ async def get_environment_simulation(
58
56
Raises:
59
57
HTTP 404 Not Found: If the env does not exist in the database.
60
58
"""
61
- env_retrieved = await self .get_environment_by_id (env_id )
62
- env_service = EnvironmentService .from_env_model (
63
- env_retrieved .environment
64
- )
59
+ env = await self .get_environment_by_id (env_id )
60
+ env_service = EnvironmentService .from_env_model (env .environment )
65
61
return env_service .get_environment_simulation ()
Original file line number Diff line number Diff line change @@ -82,10 +82,8 @@ async def get_rocketpy_flight_binary(
82
82
Raises:
83
83
HTTP 404 Not Found: If the flight is not found in the database.
84
84
"""
85
- flight_retrieved = await self .get_flight_by_id (flight_id )
86
- flight_service = FlightService .from_flight_model (
87
- flight_retrieved .flight
88
- )
85
+ flight = await self .get_flight_by_id (flight_id )
86
+ flight_service = FlightService .from_flight_model (flight .flight )
89
87
return flight_service .get_flight_binary ()
90
88
91
89
@controller_exception_handler
@@ -105,8 +103,6 @@ async def get_flight_simulation(
105
103
Raises:
106
104
HTTP 404 Not Found: If the flight does not exist in the database.
107
105
"""
108
- flight_retrieved = await self .get_flight_by_id (flight_id = flight_id )
109
- flight_service = FlightService .from_flight_model (
110
- flight_retrieved .flight
111
- )
106
+ flight = await self .get_flight_by_id (flight_id )
107
+ flight_service = FlightService .from_flight_model (flight .flight )
112
108
return flight_service .get_flight_simulation ()
Original file line number Diff line number Diff line change @@ -36,8 +36,8 @@ async def get_rocketpy_motor_binary(
36
36
Raises:
37
37
HTTP 404 Not Found: If the motor is not found in the database.
38
38
"""
39
- motor_retrieved = await self .get_motor_by_id (motor_id )
40
- motor_service = MotorService .from_motor_model (motor_retrieved .motor )
39
+ motor = await self .get_motor_by_id (motor_id )
40
+ motor_service = MotorService .from_motor_model (motor .motor )
41
41
return motor_service .get_motor_binary ()
42
42
43
43
@controller_exception_handler
@@ -54,6 +54,6 @@ async def get_motor_simulation(self, motor_id: str) -> MotorSimulation:
54
54
Raises:
55
55
HTTP 404 Not Found: If the motor does not exist in the database.
56
56
"""
57
- motor_retrieved = await self .get_motor_by_id (motor_id )
58
- motor_service = MotorService .from_motor_model (motor_retrieved .motor )
57
+ motor = await self .get_motor_by_id (motor_id )
58
+ motor_service = MotorService .from_motor_model (motor .motor )
59
59
return motor_service .get_motor_simulation ()
Original file line number Diff line number Diff line change @@ -33,10 +33,8 @@ async def get_rocketpy_rocket_binary(self, rocket_id: str) -> bytes:
33
33
Raises:
34
34
HTTP 404 Not Found: If the rocket is not found in the database.
35
35
"""
36
- rocket_retrieved = await self .get_rocket_by_id (rocket_id )
37
- rocket_service = RocketService .from_rocket_model (
38
- rocket_retrieved .rocket
39
- )
36
+ rocket = await self .get_rocket_by_id (rocket_id )
37
+ rocket_service = RocketService .from_rocket_model (rocket .rocket )
40
38
return rocket_service .get_rocket_binary ()
41
39
42
40
@controller_exception_handler
@@ -56,8 +54,6 @@ async def get_rocket_simulation(
56
54
Raises:
57
55
HTTP 404 Not Found: If the rocket does not exist in the database.
58
56
"""
59
- rocket_retrieved = await self .get_rocket_by_id (rocket_id )
60
- rocket_service = RocketService .from_rocket_model (
61
- rocket_retrieved .rocket
62
- )
57
+ rocket = await self .get_rocket_by_id (rocket_id )
58
+ rocket_service = RocketService .from_rocket_model (rocket .rocket )
63
59
return rocket_service .get_rocket_simulation ()
You can’t perform that action at this time.
0 commit comments