Skip to content

Commit

Permalink
Correctly make polls and media mutually exclusive (mastodon#10141)
Browse files Browse the repository at this point in the history
  • Loading branch information
ClearlyClaire authored and Gargron committed Mar 3, 2019
1 parent fe050b9 commit eb12d94
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/services/post_status_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def postprocess_status!
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))

Expand Down

0 comments on commit eb12d94

Please sign in to comment.