mirror of
https://github.com/discourse/discourse.git
synced 2025-06-06 13:06:56 +08:00
FIX: Don't fail silently.
This commit is contained in:
@ -267,9 +267,10 @@ class Upload < ActiveRecord::Base
|
|||||||
end
|
end
|
||||||
# store to new location & update the filesize
|
# store to new location & update the filesize
|
||||||
File.open(path) do |f|
|
File.open(path) do |f|
|
||||||
upload.url = Discourse.store.store_upload(f, upload)
|
upload.update_attributes!(
|
||||||
upload.filesize = f.size
|
url: Discourse.store.store_upload(f, upload),
|
||||||
upload.save
|
filesize: f.size
|
||||||
|
)
|
||||||
end
|
end
|
||||||
# remap the URLs
|
# remap the URLs
|
||||||
DbHelper.remap(UrlHelper.absolute(previous_url), upload.url) unless external
|
DbHelper.remap(UrlHelper.absolute(previous_url), upload.url) unless external
|
||||||
|
Reference in New Issue
Block a user