Browse Source

Correctly make polls and media mutually exclusive (#10141)

closed-social-v3
ThibG 5 years ago
committed by Eugen Rochko
parent
commit
f821eca3b3
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      app/services/post_status_service.rb

+ 1
- 1
app/services/post_status_service.rb View File

@ -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))

Loading…
Cancel
Save