about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2019-03-04 00:40:21 +0100
committerEugen Rochko <eugen@zeonfederated.com>2019-03-04 00:40:21 +0100
commitf821eca3b3ed5f3fe8d1656a3ed6d6d2c0435f96 (patch)
treee87f2d4dd5724012419b82b0a65586bddc6040fe /app
parente13d3792f322c6313fde10d639b13bc31723ec63 (diff)
Correctly make polls and media mutually exclusive (#10141)
Diffstat (limited to 'app')
-rw-r--r--app/services/post_status_service.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/services/post_status_service.rb b/app/services/post_status_service.rb
index aed680672..c045a553e 100644
--- a/app/services/post_status_service.rb
+++ b/app/services/post_status_service.rb
@@ -95,7 +95,7 @@ class PostStatusService < BaseService
   def validate_media!
     return if @options[:media_ids].blank? || !@options[:media_ids].is_a?(Enumerable)
 
-    raise Mastodon::ValidationError, I18n.t('media_attachments.validations.too_many') if @options[:media_ids].size > 4 || @options[:poll_id].present?
+    raise Mastodon::ValidationError, I18n.t('media_attachments.validations.too_many') if @options[:media_ids].size > 4 || @options[:poll].present?
 
     @media = @account.media_attachments.where(status_id: nil).where(id: @options[:media_ids].take(4).map(&:to_i))