Commit da77df3b authored by Thomas Capricelli's avatar Thomas Capricelli
Browse files

cleaning

parent ef809be88f02
......@@ -43,7 +43,7 @@ class Command(BaseCommand):
reports = ReportBadIP.objects.filter(server__user=user).distinct().order_by('updated')
if user is None:
whitelist = IPWhiteList.objects.filter(user__isnull=True)
info = "General, checking %d reports against general WhiteList (%%d items)"
info = "General, checking %d reports against general WhiteList (%d items)"
else:
whitelist = user.ipwhitelist_set
info = "User %s, checking %%d reports against both user WhiteList (%%d items) and global one." % user
......@@ -59,13 +59,14 @@ class Command(BaseCommand):
ipwl = IPWhiteList.check_against(ip_address(report.badip.ip), user)
if not ipwl: continue
# Display
self.stdout.write(self.style.WARNING('Report %d (ip=%s, reason=%s, updated=%s) fells in WhiteList %d (%s)' % (
self.stdout.write(self.style.WARNING('Report %d (ip=%s, reason=%s, updated=%s) fells in WhiteList %d (%s, %s)' % (
report.id,
str(report.badip),
str(report.reason),
str(report.updated),
ipwl.id,
str(ipwl.network),
ipwl.explanation,
)))
self.stdout.write("\t%s%s" % (baseurl, reverse("info_ip", args=[report.badip.ip,])))
self.stdout.write("\t%s%s" % (baseurl, reverse("admin:main_ipwhitelist_change", args=[ipwl.id])))
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment