diff options
author | Shel R <Yiskah.Raphen@gmail.com> | 2017-04-07 21:49:18 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-07 21:49:18 -0400 |
commit | ed332693fea75ac5f95351e5cc2627ccfc21eb04 (patch) | |
tree | cb96d7cd349ebdc93104ec05886d8256467cdaf7 /app/services/post_status_service.rb | |
parent | 41a78be25e5b4d7b5f65cfbf4d6fba5184f41475 (diff) | |
parent | 881e4277fdd5116037a86af3c711d4b6ceb240d4 (diff) |
Merge branch 'master' into patch-1
Diffstat (limited to 'app/services/post_status_service.rb')
-rw-r--r-- | app/services/post_status_service.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/services/post_status_service.rb b/app/services/post_status_service.rb index b8179f7dc..221aa42a3 100644 --- a/app/services/post_status_service.rb +++ b/app/services/post_status_service.rb @@ -37,11 +37,11 @@ class PostStatusService < BaseService def validate_media!(media_ids) return if media_ids.nil? || !media_ids.is_a?(Enumerable) - raise Mastodon::ValidationError, 'Cannot attach more than 4 files' if media_ids.size > 4 + raise Mastodon::ValidationError, I18n.t('media_attachments.validations.too_many') if media_ids.size > 4 media = MediaAttachment.where(status_id: nil).where(id: media_ids.take(4).map(&:to_i)) - raise Mastodon::ValidationError, 'Cannot attach a video to a toot that already contains images' if media.size > 1 && media.find(&:video?) + raise Mastodon::ValidationError, I18n.t('media_attachments.validations.images_and_video') if media.size > 1 && media.find(&:video?) media end |