mirror of
https://github.com/discourse/discourse.git
synced 2025-01-18 11:02:46 +08:00
correct bad logic
This commit is contained in:
parent
a0e38a52ed
commit
db7c878f3d
|
@ -123,9 +123,8 @@ class UserAvatarsController < ApplicationController
|
|||
filename = "#{sha}#{File.extname(url)}"
|
||||
path = "#{PROXY_PATH}/#{filename}"
|
||||
|
||||
if File.exist? path
|
||||
unless File.exist? path
|
||||
FileUtils.mkdir_p PROXY_PATH
|
||||
else
|
||||
tmp = FileHelper.download(url, 1.megabyte, filename, true)
|
||||
FileUtils.mv tmp.path, path
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue
Block a user