Skip to content

Commit

Permalink
Remove road_segment_name from query if road_segment_id is present.
Browse files Browse the repository at this point in the history
Convert segment_id to integer
Skip marker without accurate km when adding road_junction_km
  • Loading branch information
ziv17 committed Dec 22, 2023
1 parent 87c5698 commit 7d04158
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions anyway/widgets/widget_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@


def get_query(table_obj, filters, start_time, end_time):
if "road_segment_name" in filters and "road_segment_id" in filters:
filters = copy.copy(filters)
filters.pop("road_segment_name")
query = db.session.query(table_obj)
if start_time:
query = query.filter(getattr(table_obj, "accident_timestamp") >= start_time)
Expand Down

0 comments on commit 7d04158

Please sign in to comment.