mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-03-05 04:03:45 +08:00
Fixed permission error while cloning workflows. [fixes SCI-1291]
This commit is contained in:
parent
6b8c8deb16
commit
853096634d
1 changed files with 9 additions and 4 deletions
|
@ -73,10 +73,10 @@ class CanvasController < ApplicationController
|
||||||
poss = update_params[:positions].split(";")
|
poss = update_params[:positions].split(";")
|
||||||
center = ""
|
center = ""
|
||||||
(poss.collect { |pos| pos.split(",") }).each_with_index do |pos, index|
|
(poss.collect { |pos| pos.split(",") }).each_with_index do |pos, index|
|
||||||
unless (pos.length == 3 and
|
unless pos.length == 3 &&
|
||||||
pos[0].is_a? String and
|
pos[0].is_a?(String) &&
|
||||||
is_int? pos[1] and
|
float?(pos[1]) &&
|
||||||
is_int? pos[2])
|
float?(pos[2])
|
||||||
error = true
|
error = true
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
|
@ -318,4 +318,9 @@ class CanvasController < ApplicationController
|
||||||
/\A[-+]?\d+\z/ === val
|
/\A[-+]?\d+\z/ === val
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def float?(val)
|
||||||
|
true if Float(val)
|
||||||
|
rescue ArgumentError
|
||||||
|
false
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue