Journaling for all flights
This commit is contained in:
@@ -88,7 +88,16 @@ async def update_local_flight(
|
||||
detail="Local flight record not found"
|
||||
)
|
||||
|
||||
flight = crud_local_flight.update(db, db_obj=db_flight, obj_in=flight_in)
|
||||
# Get user IP from request
|
||||
user_ip = request.client.host if request.client else None
|
||||
|
||||
flight = crud_local_flight.update(
|
||||
db,
|
||||
db_obj=db_flight,
|
||||
obj_in=flight_in,
|
||||
user=current_user.username,
|
||||
user_ip=user_ip
|
||||
)
|
||||
|
||||
# Send real-time update
|
||||
if hasattr(request.app.state, 'connection_manager'):
|
||||
@@ -113,11 +122,14 @@ async def update_local_flight_status(
|
||||
current_user: User = Depends(get_current_operator_user)
|
||||
):
|
||||
"""Update local flight status (LANDED, CANCELLED, etc.)"""
|
||||
client_ip = get_client_ip(request)
|
||||
flight = crud_local_flight.update_status(
|
||||
db,
|
||||
flight_id=flight_id,
|
||||
status=status_update.status,
|
||||
timestamp=status_update.timestamp
|
||||
timestamp=status_update.timestamp,
|
||||
user=current_user.username,
|
||||
user_ip=client_ip
|
||||
)
|
||||
if not flight:
|
||||
raise HTTPException(
|
||||
|
||||
Reference in New Issue
Block a user