Skip to content

Commit 1219b07

Browse files
committed
[fix] formatting error in log string that was triggering 500 errors when saving (issue 1789)
1 parent 92346e2 commit 1219b07

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

c2corg_api/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -535,8 +535,9 @@ def _validate_and_convert_duration(min_duration, route_id):
535535
or min_duration < min_duration_hours
536536
or min_duration > max_duration_hours
537537
):
538-
log.warn(
539-
f"Route {route_id}: Calculated duration ({min_duration:.2f} hours if not None) is out of bounds (min={min_duration_hours}h, max={max_duration_hours}h) or NULL. Setting duration to NULL." # noqa: E501
538+
min_duration_str = "None" if min_duration is None else "{min_duration:.2f}"
539+
log.warning(
540+
f"Route {route_id}: Calculated duration (min_duration={min_duration}) is out of bounds (min={min_duration_hours}h, max={max_duration_hours}h) or NULL. Setting duration to NULL." # noqa: E501
540541
)
541542
return None
542543

0 commit comments

Comments
 (0)