X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/6aa9ec599fb44589f17bebc256b52edcc2ca95b1..618908319ca4cc33f4e14c2caba245cd7076829a:/app/controllers/relation_controller.rb diff --git a/app/controllers/relation_controller.rb b/app/controllers/relation_controller.rb index 20f5372a6..d7b9de13c 100644 --- a/app/controllers/relation_controller.rb +++ b/app/controllers/relation_controller.rb @@ -49,6 +49,10 @@ class RelationController < ApplicationController begin relation = Relation.find(params[:id]) new_relation = Relation.from_xml(request.raw_post) + if new_relation.version != relation.version + render :text => "Version mismatch: Provided " + new_relation.version.to_s + ", server had: " + relation.version.to_s, :status => :bad_request + return + end if new_relation and new_relation.id == relation.id relation.update_from new_relation, user