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:
@@ -206,7 +206,10 @@ class UploadService
|
||||
tags.join(" ")
|
||||
end
|
||||
|
||||
def download_for_upload(upload)
|
||||
def get_file_for_upload(upload, file: nil)
|
||||
return file if file.present?
|
||||
raise RuntimeError, "No file or source URL provided" if upload.source_url.blank?
|
||||
|
||||
attempts = 0
|
||||
|
||||
begin
|
||||
|
||||
Reference in New Issue
Block a user