Skip to content

Commit 21d6566

Browse files
committed
[chore] fix linting issues
(cherry picked from commit 3a540a1)
1 parent 1219b07 commit 21d6566

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

c2corg_api/__init__.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ def configure_anonymous(settings, config):
100100
account_id = int(settings.get("guidebook.anonymous_user_account"))
101101
config.registry.anonymous_user_id = account_id
102102

103+
103104
def delete_waypoint_stopareas(connection, waypoint_id):
104105
# Delete existing stopareas for waypoint
105106
delete_relation_query = text(
@@ -116,6 +117,7 @@ def delete_waypoint_stopareas(connection, waypoint_id):
116117
},
117118
)
118119

120+
119121
@event.listens_for(DocumentGeometry, "after_insert")
120122
@event.listens_for(DocumentGeometry, "after_update")
121123
def process_new_waypoint(mapper, connection, geometry):
@@ -197,7 +199,7 @@ def process_new_waypoint(mapper, connection, geometry):
197199
places_data = places_response.json()
198200

199201
if "places_nearby" not in places_data or not places_data["places_nearby"]:
200-
log.warning(f"No Navitia stops found for the waypoint {waypoint_id}; deleting previously registered stops")
202+
log.warning(f"No Navitia stops found for the waypoint {waypoint_id}; deleting previously registered stops") # noqa: E501
201203
delete_waypoint_stopareas(connection, waypoint_id)
202204
return
203205

@@ -244,7 +246,7 @@ def process_new_waypoint(mapper, connection, geometry):
244246

245247
log.warning(f"Selected {selected_count} stops out of {len(places_data['places_nearby'])} for waypoint {waypoint_id}") # noqa: E501
246248

247-
log.warning(f"Deleting previously registered stops")
249+
log.warning("Deleting previously registered stops")
248250
delete_waypoint_stopareas(connection, waypoint_id)
249251

250252
# Traiter uniquement les arrêts sélectionnés
@@ -535,9 +537,9 @@ def _validate_and_convert_duration(min_duration, route_id):
535537
or min_duration < min_duration_hours
536538
or min_duration > max_duration_hours
537539
):
538-
min_duration_str = "None" if min_duration is None else "{min_duration:.2f}"
540+
min_duration_str = "None" if min_duration is None else f"{min_duration:.2f}" # noqa: E501
539541
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
542+
f"Route {route_id}: Calculated duration (min_duration={min_duration_str}) is out of bounds (min={min_duration_hours}h, max={max_duration_hours}h) or NULL. Setting duration to NULL." # noqa: E501
541543
)
542544
return None
543545

0 commit comments

Comments
 (0)