Skip to content

Commit

Permalink
Small logic fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Pedro Rey Anca committed Oct 13, 2024
1 parent fdb118f commit d41e578
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions busGal_api/transport/expeditions.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ def get_expedition(expedition_id: int) -> Expedition:
def real_time_from_stop(stop_sitme_id: int, date: datetime = None):
"""
Will call the XUNTA's SIRI StopMonitoring, like the app does, and return information in a dict whose keys are the `CourseOfJourneyRef` of each expedition, for example:
```
```
{
103715: {
"LineRef": 8774,
Expand Down Expand Up @@ -419,8 +419,8 @@ def get_expeditions_from_stop(stop_id: int, departure_time: datetime, real_time:
type="busstop",
name=data.get("text"),
sitme_id=data.get("id_sitme"),
lat=data.get("location")["latitude"],
long=data.get("location")["longitude"])
lat=data.get("location", {}).get('latitude'),
long=data.get("location", {}).get('longitude'))

if real_time:
real_time_data_all = real_time_from_stop(
Expand Down

0 comments on commit d41e578

Please sign in to comment.