Revert "FIX: Don't fail silently."

This reverts commit baa6af93a2.
This commit is contained in:
Guo Xiang Tan 2016-09-02 11:58:56 +08:00
parent baa6af93a2
commit 692ecff3eb
1 changed files with 3 additions and 4 deletions

View File

@ -267,10 +267,9 @@ class Upload < ActiveRecord::Base
end
# store to new location & update the filesize
File.open(path) do |f|
upload.update_attributes!(
url: Discourse.store.store_upload(f, upload),
filesize: f.size
)
upload.url = Discourse.store.store_upload(f, upload)
upload.filesize = f.size
upload.save
end
# remap the URLs
DbHelper.remap(UrlHelper.absolute(previous_url), upload.url) unless external