X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/bc056a5e986df1efbbffa17df7c39e5201064537..447fef40cf9b213ec4c019cc84be5597c26edcb9:/app/controllers/amf_controller.rb diff --git a/app/controllers/amf_controller.rb b/app/controllers/amf_controller.rb index 4c9dbb114..f6ae7f231 100644 --- a/app/controllers/amf_controller.rb +++ b/app/controllers/amf_controller.rb @@ -98,7 +98,7 @@ class AmfController < ApplicationController result = startchangeset(*args) end - err = true if result[0] == -3 # If a conflict is detected, don't execute any more writes + err = true if result[0] == -3 # If a conflict is detected, don't execute any more writes end result @@ -376,8 +376,9 @@ class AmfController < ApplicationController timestamp = DateTime.strptime(timestamp.to_s, "%d %b %Y, %H:%M:%S") old_way = OldWay.where("way_id = ? AND timestamp <= ?", id, timestamp).unredacted.order("timestamp DESC").first unless old_way.nil? - points = old_way.get_nodes_revert(timestamp) - unless old_way.visible + if old_way.visible + points = old_way.get_nodes_revert(timestamp) + else return [-1, "Sorry, the way was deleted at that time - please revert to a previous version.", id] end end @@ -526,7 +527,7 @@ class AmfController < ApplicationController # 3. version. def putrelation(renumberednodes, renumberedways, usertoken, changeset_id, version, relid, tags, members, visible) #:doc: - amf_handle_error("'putrelation' #{relid}", "relation", relid) do + amf_handle_error("'putrelation' #{relid}", "relation", relid) do user = getuser(usertoken) return -1, "You are not logged in, so the relation could not be saved." unless user @@ -644,7 +645,7 @@ class AmfController < ApplicationController return -2, "Server error - node with id 0 found in way #{originalway}." if id == 0 return -2, "Server error - node with latitude -90 found in way #{originalway}." if lat == 90 - id = renumberednodes[id] if renumberednodes[id] + id = renumberednodes[id] if renumberednodes[id] node = Node.new node.changeset_id = changeset_id