prefer file over source when both are provided (#3767)

This commit is contained in:
Albert Yi
2018-06-25 14:00:02 -07:00
parent 160998daca
commit c17e0baad0
2 changed files with 11 additions and 1 deletions
+1 -1
View File
@@ -3,7 +3,7 @@ class UploadService
def self.prepare(url: nil, file: nil, ref: nil)
upload = Upload.new
if url
if Utils.is_downloadable?(url) && file.nil?
download = Downloads::File.new(url)
normalized_url, _, _ = download.before_download(url, {})
post = if normalized_url.nil?