From ac1fda35616ec814831767ded464a2d202c28de6 Mon Sep 17 00:00:00 2001 From: Anton Date: Thu, 10 Oct 2024 11:16:23 +0200 Subject: [PATCH] Fix moving location to root [SCI-11149] --- app/controllers/storage_locations_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/storage_locations_controller.rb b/app/controllers/storage_locations_controller.rb index c27da478d..75673efc4 100644 --- a/app/controllers/storage_locations_controller.rb +++ b/app/controllers/storage_locations_controller.rb @@ -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)