Skip to content

Commit

Permalink
Merge pull request #102 from ParkenDD/fix-realtime-output
Browse files Browse the repository at this point in the history
fix realtime output
  • Loading branch information
the-infinity authored Feb 29, 2024
2 parents 2b5b7bc + 81f5978 commit 9ac20d4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion webapp/models/parking_site.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,11 @@ def to_dict(self, fields: Optional[list[str]] = None, ignore: Optional[list[str]
result = super().to_dict(fields, ignore)
result = {key: value for key, value in result.items() if value is not None}

if not self.has_realtime_data:
return {key: value for key, value in result.items() if not key.startswith('realtime_')}

# If we don't have realtime support, we don't need realtime data
return {key: value for key, value in result.items() if not key.startswith('realtime_')}
return result

@hybrid_property
def park_and_ride_type(self) -> Mapped[Optional[list[ParkAndRideType]]]:
Expand Down

0 comments on commit 9ac20d4

Please sign in to comment.