diff --git a/CHANGELOG.md b/CHANGELOG.md index ed0d1e73d..4192cd0b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - Do not display the type in the plans list - Fix a bug: a message tells that creating a new plan fails, but it worked - Fix a bug: unable to select no category in plan creation/edition after a category selection +- Fix a bug: the training validation modal shows cancelled trainings ## v5.0.3 2021 June 14 diff --git a/app/controllers/api/trainings_controller.rb b/app/controllers/api/trainings_controller.rb index c0ba04b19..af36f907b 100644 --- a/app/controllers/api/trainings_controller.rb +++ b/app/controllers/api/trainings_controller.rb @@ -60,7 +60,8 @@ class API::TrainingsController < API::ApiController @training = Training.find(params[:id]) @availabilities = @training.availabilities .includes(slots: { reservations: { statistic_profile: [:trainings, user: [:profile]] } }) - .order('start_at DESC') + .where('slots.canceled_at': nil) + .order('availabilities.start_at DESC') end private