Fix #3983: Uploads: NoMethodError - undefined method `>=' for nil:NilClass
* Rename Upload#download_for_upload to #get_file_for_upload. * Fix #get_file_for_upload to raise error if no file or source url was given. * Fix javascript upload validation to disallow submitting form if file is not present and the source is not an url.
This commit is contained in:
@@ -48,13 +48,8 @@ class UploadService
|
||||
|
||||
@upload.update(status: "processing")
|
||||
|
||||
if @upload.file.nil? && @upload.source_url.present?
|
||||
@upload.file = Utils.download_for_upload(@upload)
|
||||
end
|
||||
|
||||
if @upload.file.present?
|
||||
Utils.process_file(upload, @upload.file)
|
||||
end
|
||||
@upload.file = Utils.get_file_for_upload(@upload, file: @upload.file)
|
||||
Utils.process_file(upload, @upload.file)
|
||||
|
||||
@upload.save!
|
||||
@post = create_post_from_upload(@upload)
|
||||
|
||||
Reference in New Issue
Block a user