1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-02-20 14:54:15 +01:00

Fix a bug: public availabilities (no user) was buggy (server error)

This commit is contained in:
Nicolas Florentin 2023-09-27 15:39:00 +02:00
parent fe1b555990
commit 73f30de587
2 changed files with 2 additions and 1 deletions

View File

@ -3,6 +3,7 @@
## next release
- Fix a bug: unable to sync projects with openprojects
- Fix a bug: public availabilities (no user) was buggy (server error)
- [TODO DEPLOY] `rails fablab:openlab:bulk_export`
- [TODO DEPLOY] `rails fablab:openlab:bulk_update`

View File

@ -141,7 +141,7 @@ class Availabilities::AvailabilitiesService
end
def flag_or_remove_blocked_slots(slots, blocked_slots, user)
if user.admin? || user.manager?
if user && (user.admin? || user.manager?)
blocked_slots.each do |slot|
slot.is_blocked = true
end