Skip to content

Commit

Permalink
[uss_qualifier] Check for presence of includes_advisories before ac…
Browse files Browse the repository at this point in the history
…cessing field (interuss#439)

Check for presence of `includes_advisories` before accessing field
  • Loading branch information
BenjaminPelletier authored Dec 21, 2023
1 parent 9885986 commit 51ef122
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
5 changes: 4 additions & 1 deletion monitoring/monitorlib/clients/flight_planning/client_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
)
from monitoring.monitorlib.clients.flight_planning.planning import (
PlanningActivityResponse,
AdvisoryInclusion,
)
from monitoring.monitorlib.clients.flight_planning.planning import (
PlanningActivityResult,
Expand Down Expand Up @@ -93,7 +94,9 @@ def _inject(
queries=[query],
activity_result=resp.planning_result,
flight_plan_status=resp.flight_plan_status,
includes_advisories=resp.includes_advisories,
includes_advisories=resp.includes_advisories
if "includes_advisories" in resp
else AdvisoryInclusion.Unknown,
)

return response
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,14 @@ def request_flight(
operational_intent_id="<not provided>",
)

return response, resp.queries[0], flight_id, resp.includes_advisories
return (
response,
resp.queries[0],
flight_id,
resp.includes_advisories
if "includes_advisories" in resp
else AdvisoryInclusion.Unknown,
)

def cleanup_flight(
self, flight_id: str
Expand Down

0 comments on commit 51ef122

Please sign in to comment.