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

fix change space reservation when many users on the slot does not change the good user

This commit is contained in:
Sylvain 2017-03-01 14:47:59 +01:00
parent 3c6bcccd0d
commit f208caf5b0

View File

@ -279,11 +279,11 @@ class API::AvailabilitiesController < API::ApiController
r.slots.each do |s|
if slot.space.id == r.reservable_id
if s.start_at == slot.start_at and s.canceled_at == nil
slot.id = s.id
slot.can_modify = true if user_role === 'admin'
slot.reservations.push r
end
if s.start_at == slot.start_at and r.user == user and s.canceled_at == nil
slot.id = s.id
slot.title = t('availabilities.i_ve_reserved')
slot.can_modify = true
slot.is_reserved = true