Make it possible to fully delete unlisted/unrated extensions #81

Merged
Anna Sirota merged 24 commits from fully-delete-extension into main 2024-04-19 11:00:19 +02:00
Showing only changes of commit b06768a152 - Show all commits

View File

@ -1,3 +1,4 @@
import logging
import random
from django.core.management.base import BaseCommand
@ -61,6 +62,15 @@ class Command(BaseCommand):
help = 'Generate fake data with extensions, users and versions using test factories.'
def handle(self, *args, **options):
verbosity = int(options['verbosity'])
root_logger = logging.getLogger('root')
if verbosity > 2:
root_logger.setLevel(logging.DEBUG)
elif verbosity > 1:
root_logger.setLevel(logging.INFO)
else:
root_logger.setLevel(logging.WARNING)
tags = {
type_id: list(Tag.objects.filter(type=type_id).values_list('name', flat=True))
for type_id, _ in Extension.TYPES