Skip to content

Commit 476e860

Browse files
committed
Fixed the clear_index management command to respect --verbosity. Thanks to kylemacfarlane for the report.
1 parent c076768 commit 476e860

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

haystack/management/commands/clear_index.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ def handle(self, **options):
1616
"""Clears out the search index completely."""
1717
# Cause the default site to load.
1818
from haystack import site
19+
self.verbosity = int(options.get('verbosity', 1))
1920

2021
if options.get('interactive', True):
2122
print
@@ -29,10 +30,12 @@ def handle(self, **options):
2930
print "No action taken."
3031
sys.exit()
3132

32-
print "Removing all documents from your index because you said so."
33+
if self.verbosity >= 1:
34+
print "Removing all documents from your index because you said so."
3335

3436
from haystack import backend
3537
sb = backend.SearchBackend()
3638
sb.clear()
3739

38-
print "All documents removed."
40+
if self.verbosity >= 1:
41+
print "All documents removed."

0 commit comments

Comments
 (0)