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:
parent
9f235d5c3b
commit
eb4f97000d
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user