Skip to content

Commit 1b7c9b7

Browse files
author
Manan
committed
TRAN-5069 : Conditional Changes
1 parent eb8db25 commit 1b7c9b7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

gtfs_realtime_translators/translators/njt_bus.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,10 @@ def __make_trip_updates(cls, data, filtered_stops):
6464
scheduled_datetime = cls.__to_unix_time("{} {}".format(scheduleddeparturedate.title(), scheduleddeparturetime))
6565
scheduled_departure_time = int(scheduled_datetime.timestamp())
6666

67-
arrival_time = int(scheduled_datetime.add(seconds=int(stop['sec_late'])).timestamp())
67+
sec_late = 0
68+
if not stop['sec_late']:
69+
sec_late = int(stop['sec_late'])
70+
arrival_time = int(scheduled_datetime.add(seconds=sec_late).timestamp())
6871

6972
trip_update = TripUpdate.create(entity_id=str(idx + 1),
7073
route_id=route_id,

0 commit comments

Comments
 (0)