Skip to content

Commit f844a44

Browse files
Update lib/controllers/flight.py
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
1 parent 208ab37 commit f844a44

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/controllers/flight.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,10 @@ async def create_flight(
7373
else:
7474
return FlightCreated(flight_id=flight_repo.flight_id)
7575
finally:
76-
if flight_repo:
77-
logger.info(
78-
f"Call to controllers.flight.create_flight completed for Flight {flight_repo.flight_id}"
79-
)
76+
flight_id = getattr(flight_repo, 'flight_id', 'unknown') if flight_repo else 'unknown'
77+
logger.info(
78+
f"Call to controllers.flight.create_flight completed for Flight {flight_id}"
79+
)
8080

8181
@staticmethod
8282
async def get_flight_by_id(

0 commit comments

Comments
 (0)