Merge pull request #4455 from tgxworld/fix_category_logo_url

FIX: Form CDN URL client side instead.
This commit is contained in:
Régis Hanol
2016-09-22 11:01:16 +02:00
committed by GitHub
9 changed files with 18 additions and 84 deletions

View File

@@ -3,7 +3,7 @@ class UploadUrlValidator < ActiveModel::EachValidator
if value.present?
uri = URI.parse(value) rescue nil
unless uri && Discourse.store.has_been_uploaded?(value)
unless uri && Upload.exists?(url: value)
record.errors[attribute] << (options[:message] || I18n.t('errors.messages.invalid'))
end
end