Skip to content

Commit 10a104b

Browse files
adapts rocket repository to comply with rocket controller
1 parent 54f7c08 commit 10a104b

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

lib/controllers/flight.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,9 +195,7 @@ async def get_rocketpy_flight_as_jsonpickle(
195195
detail="Failed to read flight: {e}",
196196
) from e
197197
else:
198-
rocketpy_flight = await cls.get_rocketpy_flight(
199-
read_flight
200-
)
198+
rocketpy_flight = await cls.get_rocketpy_flight(read_flight)
201199
return FlightPickle(
202200
jsonpickle_rocketpy_flight=jsonpickle.encode(rocketpy_flight)
203201
)

lib/repositories/rocket.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def __del__(self):
2929
super().__del__()
3030

3131
async def create_rocket(
32-
self, rocket_option: str = "Calisto"
32+
self, rocket_option: str = "Calisto", motor_kind: str = "Solid"
3333
) -> "InsertOneResult":
3434
"""
3535
Creates a rocket in the database
@@ -45,6 +45,7 @@ async def create_rocket(
4545
rocket_to_dict = self.rocket.dict()
4646
rocket_to_dict["rocket_id"] = self.rocket_id
4747
rocket_to_dict["rocket_option"] = rocket_option
48+
rocket_to_dict["motor"]["motor_kind"] = motor_kind
4849
return await self.collection.insert_one(rocket_to_dict)
4950
except Exception as e:
5051
raise Exception(f"Error creating rocket: {str(e)}") from e

0 commit comments

Comments
 (0)