summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2015-08-26 15:47:41 -0400
committerTim Graham <timograham@gmail.com>2015-08-28 13:34:56 -0400
commit01b2b0b6543afdaf30623b7a779b7fe4514a9c7b (patch)
tree18c8a6d5612bce107621c882beb6c8b51cd3b014
parent2bb1027d6bcdad59624a9d08701e0d2e4a9c0ba7 (diff)
Fixed #25318 -- Made SILENCED_SYSTEM_CHECKS suppress all messages.
Previously, messages of ERROR level or higher were printed to the console.
-rw-r--r--django/core/management/base.py4
-rw-r--r--docs/ref/settings.txt8
-rw-r--r--docs/releases/1.9.txt4
-rw-r--r--tests/check_framework/tests.py10
4 files changed, 14 insertions, 12 deletions
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])