mirror of
https://framagit.org/tykayn/mastodon.git
synced 2023-08-25 08:33:12 +02:00
Fix domain block export not exporting blocks with only media rejection
This commit is contained in:
parent
bbdf61c9e4
commit
26ff48ee48
@ -62,7 +62,7 @@ module Admin
|
|||||||
|
|
||||||
def export_data
|
def export_data
|
||||||
CSV.generate(headers: export_headers, write_headers: true) do |content|
|
CSV.generate(headers: export_headers, write_headers: true) do |content|
|
||||||
DomainBlock.with_user_facing_limitations.each do |instance|
|
DomainBlock.with_limitations.each do |instance|
|
||||||
content << [instance.domain, instance.severity, instance.reject_media, instance.reject_reports, instance.public_comment, instance.obfuscate]
|
content << [instance.domain, instance.severity, instance.reject_media, instance.reject_reports, instance.public_comment, instance.obfuscate]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -29,6 +29,7 @@ class DomainBlock < ApplicationRecord
|
|||||||
|
|
||||||
scope :matches_domain, ->(value) { where(arel_table[:domain].matches("%#{value}%")) }
|
scope :matches_domain, ->(value) { where(arel_table[:domain].matches("%#{value}%")) }
|
||||||
scope :with_user_facing_limitations, -> { where(severity: [:silence, :suspend]) }
|
scope :with_user_facing_limitations, -> { where(severity: [:silence, :suspend]) }
|
||||||
|
scope :with_limitations, -> { where(severity: [:silence, :suspend]).or(where(reject_media: true)) }
|
||||||
scope :by_severity, -> { order(Arel.sql('(CASE severity WHEN 0 THEN 1 WHEN 1 THEN 2 WHEN 2 THEN 0 END), domain')) }
|
scope :by_severity, -> { order(Arel.sql('(CASE severity WHEN 0 THEN 1 WHEN 1 THEN 2 WHEN 2 THEN 0 END), domain')) }
|
||||||
|
|
||||||
def to_log_human_identifier
|
def to_log_human_identifier
|
||||||
|
Loading…
Reference in New Issue
Block a user