Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Only print if verbosity flag is used.

  • Loading branch information...
commit c6427f632dfb7dae0f43c472f34391bc4a12e142 1 parent 99cf34d
@justinabrahms justinabrahms authored
View
4 django_website/apps/aggregator/management/commands/mark_defunct_feeds.py
@@ -7,12 +7,14 @@ class Command(BaseCommand):
Mark people with 404'ing feeds as defunct.
"""
def handle(self, *args, **kwargs):
+ verbose = kwargs.get('verbosity')
for f in Feed.objects.all():
try:
r = urllib2.urlopen(f.feed_url)
except urllib2.HTTPError, e:
if e.code == 404 or e.code == 500:
- print "%s on %s; marking defunct" % (e.code, f)
+ if verbose:
+ print "%s on %s; marking defunct" % (e.code, f)
f.is_defunct = True
f.save()
else:
Please sign in to comment.
Something went wrong with that request. Please try again.