0
0
Fork 0

Provide a link to existing domain block when trying to block an already-blocked domain (#10663)

* When trying to block an already-blocked domain, provide a link to the block

* Fix styling for links in flash messages

* Allow blocks to be upgraded but not downgraded
This commit is contained in:
ThibG 2019-05-03 20:36:36 +02:00 committed by Eugen Rochko
parent eb63217210
commit 011b032300
6 changed files with 79 additions and 6 deletions

View file

@ -29,4 +29,11 @@ class DomainBlock < ApplicationRecord
def self.blocked?(domain)
where(domain: domain, severity: :suspend).exists?
end
def stricter_than?(other_block)
return true if suspend?
return false if other_block.suspend? && (silence? || noop?)
return false if other_block.silence? && noop?
(reject_media || !other_block.reject_media) && (reject_reports || !other_block.reject_reports)
end
end