Small fix if there are multiple identical stops in a same trip
This commit is contained in:
parent
d679aadf68
commit
9f3c031851
|
@ -194,8 +194,12 @@ class Command(BaseCommand):
|
|||
st.drop_off_type = 1
|
||||
st.save()
|
||||
else:
|
||||
st = StopTime.objects.get(Q(stop=stop_id) | Q(stop__parent_station_id=stop_id),
|
||||
trip_id=trip_id)
|
||||
qs = StopTime.objects.filter(Q(stop=stop_id) | Q(stop__parent_station_id=stop_id),
|
||||
trip_id=trip_id)
|
||||
if qs.count() == 1:
|
||||
st = qs.first()
|
||||
else:
|
||||
st = qs.get(stop_sequence=stop_sequence)
|
||||
if st.stop_sequence != stop_sequence:
|
||||
st.stop_sequence = stop_sequence
|
||||
st.save()
|
||||
|
|
Loading…
Reference in New Issue