summaryrefslogtreecommitdiff
path: root/app/uploaders
diff options
context:
space:
mode:
authorMicaël Bergeron <mbergeron@gitlab.com>2018-01-30 14:38:10 -0500
committerMicaël Bergeron <mbergeron@gitlab.com>2018-02-02 09:32:20 -0500
commitce84d1835332932e25ebdc2cfbe44ff301328a1f (patch)
tree6d7d61902152c05d6add90740defa1aa37ed9d5e /app/uploaders
parent2b1536407fb42c1563fb41e2ee82e686e660ce11 (diff)
downloadgitlab-ce-ce84d1835332932e25ebdc2cfbe44ff301328a1f.tar.gz
apply fixes from feedback42547-upload-store-mount-point
Diffstat (limited to 'app/uploaders')
-rw-r--r--app/uploaders/file_uploader.rb16
1 files changed, 9 insertions, 7 deletions
diff --git a/app/uploaders/file_uploader.rb b/app/uploaders/file_uploader.rb
index cc4e7a38165..2310e67cb2e 100644
--- a/app/uploaders/file_uploader.rb
+++ b/app/uploaders/file_uploader.rb
@@ -110,14 +110,16 @@ class FileUploader < GitlabUploader
end
def upload=(value)
- unless apply_context!(value.uploader_context)
- if matches = DYNAMIC_PATH_PATTERN.match(value.path)
- @secret = matches[:secret]
- @identifier = matches[:identifier]
- end
- end
-
super
+
+ return unless value
+ return if apply_context!(value.uploader_context)
+
+ # fallback to the regex based extraction
+ if matches = DYNAMIC_PATH_PATTERN.match(value.path)
+ @secret = matches[:secret]
+ @identifier = matches[:identifier]
+ end
end
def secret