diff --git a/CHANGELOG.md b/CHANGELOG.md index bff7d0f34..2f3a9077c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - Fix a bug: misconfigured Twitter's ENV variables results in HTTP error 500 - Fix a bug: wallet is not debited when paying locally with a user who have invoices disabled - Fix a bug: wrong error message about rounding inconsistency is logged on invoice generation +- Fix a bug: reservation calendar of a specific training shows availabilities for all trainings ## v2.4.4 2016 November 24 diff --git a/app/controllers/api/availabilities_controller.rb b/app/controllers/api/availabilities_controller.rb index 088e98bb6..1c99961e5 100644 --- a/app/controllers/api/availabilities_controller.rb +++ b/app/controllers/api/availabilities_controller.rb @@ -126,8 +126,8 @@ class API::AvailabilitiesController < API::ApiController # what is requested? # 1) a single training - if params[:training_id].is_number? - @availabilities = Training.find(params[:training_id]).availabilities + if params[:training_id].is_number? or (params[:training_id].length > 0 and params[:training_id] != 'all') + @availabilities = Training.friendly.find(params[:training_id]).availabilities # 2) all trainings else @availabilities = Availability.trainings