Skip to content
Snippets Groups Projects
Commit f821eca3 authored by ThibG's avatar ThibG Committed by Eugen Rochko
Browse files

Correctly make polls and media mutually exclusive (#10141)

parent e13d3792
No related branches found
No related tags found
No related merge requests found
......@@ -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))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment