X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/c38e4bf4a0f76550300386bbabf4bdda943e56c1..1ecf13d8461b2b0c597ba8b6492f6ffd973c61a0:/app/controllers/segment_controller.rb diff --git a/app/controllers/segment_controller.rb b/app/controllers/segment_controller.rb index 7e77609f3..5f2603f0b 100644 --- a/app/controllers/segment_controller.rb +++ b/app/controllers/segment_controller.rb @@ -13,11 +13,11 @@ class SegmentController < ApplicationController segment.user_id = @user.id - a = Node.find(segment.node_a.to_i) - b = Node.find(segment.node_b.to_i) + segment.from_node = Node.find(segment.node_a.to_i) + segment.to_node = Node.find(segment.node_b.to_i) - unless a and a.visible and b and b.visible - render :nothing => true, :status => 400 + unless segment.precondtions_ok? # are the nodes visible? + render :nothing => true, :status => 412 end if segment.save_with_history