mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-02-19 13:54:25 +01:00
(bug) event canceled places error
This commit is contained in:
parent
51c4e020f9
commit
f8edc5bf9e
@ -3,6 +3,8 @@
|
||||
## Next release
|
||||
|
||||
- improvement: add idp_slo_service_url(logout requests url) to saml provider
|
||||
- Fix a bug: event canceled places error
|
||||
- [TODO DEPLOY] `rails fablab:setup:build_places_cache`
|
||||
|
||||
## v6.3.13 2024 February 19
|
||||
|
||||
|
@ -66,10 +66,13 @@ class SlotsReservation < ApplicationRecord
|
||||
# @param target_slot [Slot]
|
||||
def update_places_cache(operation, target_slot = slot)
|
||||
if reservation.reservable_type == 'Event'
|
||||
total_booked_seats = reservation.nb_reserve_places
|
||||
total_booked_seats += reservation.tickets.map(&:booked).map(&:to_i).reduce(:+) if reservation.tickets.count.positive?
|
||||
total_booked_seats = 0 if reservation.reservable.pre_registration
|
||||
Slots::PlacesCacheService.change_places(target_slot,
|
||||
reservation.reservable_type,
|
||||
reservation.reservable_id,
|
||||
reservation.reservable.pre_registration ? 0 : reservation.total_booked_seats,
|
||||
total_booked_seats,
|
||||
operation)
|
||||
else
|
||||
Slots::PlacesCacheService.change_places(target_slot, reservation.reservable_type, reservation.reservable_id, 1, operation)
|
||||
|
Loading…
x
Reference in New Issue
Block a user