Commit f13158a0 authored by Stan Hu's avatar Stan Hu

Merge branch 'do-not-perform-disk-check' into 'master'

Do not perform hard check (presence of file on storage)

Closes #37945

See merge request gitlab-org/gitlab-ce!14369
parents 02b398d3 263717d7
...@@ -28,7 +28,7 @@ class Projects::UploadsController < Projects::ApplicationController ...@@ -28,7 +28,7 @@ class Projects::UploadsController < Projects::ApplicationController
end end
def image_or_video? def image_or_video?
uploader && uploader.file.exists? && uploader.image_or_video? uploader && uploader.exists? && uploader.image_or_video?
end end
def uploader_class def uploader_class
......
...@@ -9,7 +9,7 @@ class AvatarUploader < GitlabUploader ...@@ -9,7 +9,7 @@ class AvatarUploader < GitlabUploader
end end
def exists? def exists?
model.avatar.file && model.avatar.file.exists? model.avatar.file && model.avatar.file.present?
end end
# We set move_to_store and move_to_cache to 'false' to prevent stealing # We set move_to_store and move_to_cache to 'false' to prevent stealing
......
...@@ -51,7 +51,7 @@ class GitlabUploader < CarrierWave::Uploader::Base ...@@ -51,7 +51,7 @@ class GitlabUploader < CarrierWave::Uploader::Base
end end
def exists? def exists?
file.try(:exists?) file.present?
end end
# Override this if you don't want to save files by default to the Rails.root directory # Override this if you don't want to save files by default to the Rails.root directory
......
---
title: File uploaders do not perform hard check, only soft check
merge_request:
author:
type: fixed
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment