Remove implied setting of reject_media/reports
if severity is set to 'suspend'. Complicates understanding of what the code actually does.
This commit is contained in:
parent
04c19c62df
commit
3aa2e378e3
|
@ -127,8 +127,6 @@ class DomainBlock(object):
|
|||
"""Initialize the DomainBlock
|
||||
"""
|
||||
self.domain = domain
|
||||
# Set severity first so if reject_media or reject_reports = False
|
||||
# that overrides the default of True for severity = 'suspend'
|
||||
self.severity = severity
|
||||
self.public_comment = public_comment
|
||||
self.private_comment = private_comment
|
||||
|
@ -148,12 +146,6 @@ class DomainBlock(object):
|
|||
else:
|
||||
self._severity = BlockSeverity(sev)
|
||||
|
||||
# Suspend implies reject_media,reject_reports == True
|
||||
log.debug('Suspend blocks media and reports')
|
||||
if self._severity.level == SeverityLevel.SUSPEND:
|
||||
self.reject_media = True
|
||||
self.reject_reports = True
|
||||
|
||||
def _asdict(self):
|
||||
"""Return a dict version of this object
|
||||
"""
|
||||
|
|
|
@ -72,12 +72,3 @@ def test_compare_diff_sevs_2():
|
|||
b = DomainBlock('example1.org', 'noop')
|
||||
|
||||
assert a != b
|
||||
|
||||
def test_suspend_rejects():
|
||||
"""A suspend should reject_media and reject_reports
|
||||
"""
|
||||
a = DomainBlock('example.org', 'suspend')
|
||||
|
||||
assert a.severity.level == SeverityLevel.SUSPEND
|
||||
assert a.reject_media == True
|
||||
assert a.reject_reports == True
|
Loading…
Reference in New Issue