X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/41f85fb77dbd0c16f12e49091b14fcaa1264ad70..ed0a1658dfa03dbb743b329cbd0f0d8e40377278:/app/controllers/amf_controller.rb diff --git a/app/controllers/amf_controller.rb b/app/controllers/amf_controller.rb index 5ff42fdd2..62c9be986 100644 --- a/app/controllers/amf_controller.rb +++ b/app/controllers/amf_controller.rb @@ -362,7 +362,7 @@ class AmfController < ApplicationController waycreated=revdates[0] revdates.uniq! revdates.sort! - revdates.reverse! + revdates.reverse! # Remove any dates (from nodes) before first revision date of way revdates.delete_if { |d| d ex + # We don't do anything here as the node is being used elsewhere + # and we don't want to delete it + end end end # transaction @@ -690,7 +695,8 @@ class AmfController < ApplicationController # We're deleting the node node.delete_with_history!(new_node, user) end - end # transaction + + end # transaction if id <= 0 return [0, id, new_node.id, new_node.version] @@ -763,7 +769,12 @@ class AmfController < ApplicationController new_node = Node.new new_node.changeset_id = changeset_id new_node.version = v.to_i - node.delete_with_history_unless_used!(new_node, user) + begin + node.delete_with_history!(new_node, user) + rescue OSM::APIPreconditionFailedError => ex + # We don't do anything with the exception as the node is in use + # elsewhere and we don't want to delete it + end end end # transaction