Skip to content

Commit

Permalink
Merge pull request #134 from Studio-Yandex-Practicum-Hackathons/featu…
Browse files Browse the repository at this point in the history
…re/bot/client-comments

fix route start without any steps
  • Loading branch information
dcomrad authored Oct 11, 2023
2 parents 42e6fa6 + cbbed02 commit 6824684
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions bot/handlers/route.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,13 @@ async def route_selection(
await answer_with_delay(message, state, NO_ROUTES)
return

routes = {route.name: route for route in db_routes[:3] if route.stages}
routes = {
route.name: route
for route in db_routes[:3]
if any(route.stages)
}

if await state.get_state() != Route.selection:
if routes and await state.get_state() != Route.selection:
await state.set_state(Route.selection)
await answer_with_delay(
message,
Expand Down

0 comments on commit 6824684

Please sign in to comment.