API & Client: minor fix

This commit is contained in:
Sam
2018-05-28 23:37:53 +02:00
parent 66343c16b8
commit 1ac669e6e6
2 changed files with 64 additions and 50 deletions

View File

@ -202,7 +202,9 @@ def get_chart_data(gpx_file):
)
distance = 0 if distance is None else distance
distance += previous_distance
speed = round((segment.get_speed(point_idx) / 1000)*3600, 2)
speed = (round((segment.get_speed(point_idx) / 1000)*3600, 2)
if segment.get_speed(point_idx) is not None
else 0)
chart_data.append({
'distance': round(distance / 1000, 2),
'duration': point.time_difference(first_point),