Commit 834c4f5b authored by Michael Kozono's avatar Michael Kozono
Browse files

Ensure data integrity

parent 5c81806dcedb
......@@ -7,6 +7,10 @@ def move_dir
raise'Namespace cannot be moved, because at least one project has tags in container registry')
parent_was = if parent_changed? && parent_id_was.present?
Namespace.find(parent_id_was) # raise NotFound early if needed
# Move the namespace directory in all storage paths used by member projects
......@@ -28,7 +32,7 @@ def move_dir
if parent_changed?
former_parent_full_path = parent_id_was.nil? ? nil : Namespace.find(parent_id_was).full_path
former_parent_full_path = parent_was.full_path
parent_full_path = parent&.full_path, former_parent_full_path, parent_full_path), former_parent_full_path, parent_full_path)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment