Skip to content

Commit

Permalink
Winterthur: Fix json and csv mission report views in case of no vehic…
Browse files Browse the repository at this point in the history
…le symbol

TYPE: Bugfix
LINK: ogc-1819, ogc-1931
  • Loading branch information
Tschuppi81 authored Nov 28, 2024
1 parent 0df602b commit a58353c
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/onegov/winterthur/views/mission_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,9 @@ def view_mission_reports_as_json(
for _ in range(use.count)
],
'vehicles_icons': [
request.link(use.vehicle.symbol) for use in
mission.used_vehicles
request.link(use.vehicle.symbol)
if use.vehicle.symbol else ''
for use in mission.used_vehicles
for _ in range(use.count)
],
'location': mission.location,
Expand Down Expand Up @@ -260,10 +261,13 @@ def view_mission_reports_as_csv(
mission.mission_count,
', '.join([
use.vehicle.name for use in mission.used_vehicles for _ in
range(use.count)]),
range(use.count)
]),
', '.join([
request.link(use.vehicle.symbol) for use in
mission.used_vehicles for _ in range(use.count)]),
request.link(use.vehicle.symbol)
if use.vehicle.symbol else ''
for use in mission.used_vehicles for _ in range(use.count)
]),
mission.location,
mission.personnel,
mission.backup,
Expand Down

0 comments on commit a58353c

Please sign in to comment.