diff --git a/django/core/management/base.py b/django/core/management/base.py index 665b7da1fb..e20944e277 100644 --- a/django/core/management/base.py +++ b/django/core/management/base.py @@ -438,8 +438,8 @@ class BaseCommand(object): debugs = [e for e in all_issues if e.level < checks.INFO and not e.is_silenced()] infos = [e for e in all_issues if checks.INFO <= e.level < checks.WARNING and not e.is_silenced()] warnings = [e for e in all_issues if checks.WARNING <= e.level < checks.ERROR and not e.is_silenced()] - errors = [e for e in all_issues if checks.ERROR <= e.level < checks.CRITICAL] - criticals = [e for e in all_issues if checks.CRITICAL <= e.level] + errors = [e for e in all_issues if checks.ERROR <= e.level < checks.CRITICAL and not e.is_silenced()] + criticals = [e for e in all_issues if checks.CRITICAL <= e.level and not e.is_silenced()] sorted_issues = [ (criticals, 'CRITICALS'), (errors, 'ERRORS'), diff --git a/docs/ref/settings.txt b/docs/ref/settings.txt index 331e117060..217f54281d 100644 --- a/docs/ref/settings.txt +++ b/docs/ref/settings.txt @@ -2195,8 +2195,12 @@ Default: ``[]`` (Empty list) A list of identifiers of messages generated by the system check framework (i.e. ``["models.W001"]``) that you wish to permanently acknowledge and ignore. -Silenced warnings will no longer be output to the console; silenced errors -will still be printed, but will not prevent management commands from running. +Silenced checks will not be output to the console. + +.. versionchanged:: 1.9 + + In older versions, silenced messages of ``ERROR`` level or higher were + printed to the console. See also the :doc:`/ref/checks` documentation. diff --git a/docs/releases/1.9.txt b/docs/releases/1.9.txt index d9bee08ce3..2eace132e7 100644 --- a/docs/releases/1.9.txt +++ b/docs/releases/1.9.txt @@ -989,6 +989,10 @@ Miscellaneous Set ``request.current_app`` to ``None`` if you don't want to use a namespace hint. +* The :setting:`SILENCED_SYSTEM_CHECKS` setting now silences messages of all + levels. Previously, messages of ``ERROR`` level or higher were printed to the + console. + .. _deprecated-features-1.9: Features deprecated in 1.9 diff --git a/tests/check_framework/tests.py b/tests/check_framework/tests.py index a7cc9ad6fc..03bc01f843 100644 --- a/tests/check_framework/tests.py +++ b/tests/check_framework/tests.py @@ -232,14 +232,8 @@ class SilencingCheckTests(SimpleTestCase): call_command('check', stdout=out, stderr=err) except CommandError: self.fail("The mycheck.E001 check should be silenced.") - self.assertEqual(out.getvalue(), '') - self.assertEqual( - err.getvalue(), - 'System check identified some issues:\n\n' - 'ERRORS:\n' - '?: (myerrorcheck.E001) Error\n\n' - 'System check identified 1 issue (0 silenced).\n' - ) + self.assertEqual(out.getvalue(), 'System check identified no issues (1 silenced).\n') + self.assertEqual(err.getvalue(), '') @override_settings(SILENCED_SYSTEM_CHECKS=['mywarningcheck.E001']) @override_system_checks([custom_warning_system_check])