Source code for username_tools.management.commands.clear_blacklist
from django.core.management import BaseCommand
from username_tools.models import UsernameBlacklist
[docs]class Command(BaseCommand):
[docs] def handle(self, *args, **kwargs):
queryset = UsernameBlacklist.objects.all()
count = queryset.count()
queryset.delete()
self.stdout.write("Removed {} items from the database.".format(count))