correct bad logic
This commit is contained in:
parent
a0e38a52ed
commit
db7c878f3d
|
@ -123,9 +123,8 @@ class UserAvatarsController < ApplicationController
|
||||||
filename = "#{sha}#{File.extname(url)}"
|
filename = "#{sha}#{File.extname(url)}"
|
||||||
path = "#{PROXY_PATH}/#{filename}"
|
path = "#{PROXY_PATH}/#{filename}"
|
||||||
|
|
||||||
if File.exist? path
|
unless File.exist? path
|
||||||
FileUtils.mkdir_p PROXY_PATH
|
FileUtils.mkdir_p PROXY_PATH
|
||||||
else
|
|
||||||
tmp = FileHelper.download(url, 1.megabyte, filename, true)
|
tmp = FileHelper.download(url, 1.megabyte, filename, true)
|
||||||
FileUtils.mv tmp.path, path
|
FileUtils.mv tmp.path, path
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue