Merge pull request #7955 from aignatov-bio/ai-sci-11149-fix-moving-location-to-root

Fix moving location to root [SCI-11149]
This commit is contained in:
aignatov-bio 2024-10-10 14:34:33 +02:00 committed by GitHub
commit 8aad40ccbe
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -107,7 +107,7 @@ class StorageLocationsController < ApplicationController
StorageLocation.find(move_params[:destination_storage_location_id])
end
render_403 and return unless can_manage_storage_location?(destination_storage_location)
render_403 and return if destination_storage_location && !can_manage_storage_location?(destination_storage_location)
@storage_location.update!(parent: destination_storage_location)