1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-01-29 18:52:22 +01:00

[bug] admin cannot see all space availabilities

This commit is contained in:
Sylvain 2017-08-24 16:53:27 +02:00
parent 9f235d5c3b
commit eb4f97000d
2 changed files with 2 additions and 1 deletions

View File

@ -2,6 +2,7 @@
## next release
- Fix a bug: admins cannot see all availabilities for spaces in reservation calendar when a user is selected
- Fix a bug: missing translation after payment in english and portuguese
- Updated puma for compatibility with openSSL > 1.0
- Documented installation on ArchLinux

View File

@ -190,7 +190,7 @@ class API::AvailabilitiesController < API::ApiController
@space = Space.friendly.find(params[:space_id])
@slots = []
@reservations = Reservation.where('reservable_type = ? and reservable_id = ?', @space.class.to_s, @space.id).includes(:slots, user: [:profile]).references(:slots, :user).where('slots.start_at > ?', Time.now)
if @user.is_admin?
if current_user.is_admin?
@availabilities = @space.availabilities.includes(:tags).where("end_at > ? AND available_type = 'space'", Time.now)
else
end_at = 1.month.since