Show More
@@ -13,7 +13,7 b' class Command(BaseCommand):' | |||||
13 |
|
13 | |||
14 | @transaction.atomic |
|
14 | @transaction.atomic | |
15 | def handle(self, *args, **options): |
|
15 | def handle(self, *args, **options): | |
16 | empty = Tag.objects.annotate(num_threads=Count('thread'))\ |
|
16 | empty = Tag.objects.annotate(num_threads=Count('thread_tags'))\ | |
17 | .filter(num_threads=0).order_by('-required', 'name') |
|
17 | .filter(num_threads=0).order_by('-required', 'name') | |
18 | print('Removing {} empty tags'.format(empty.count())) |
|
18 | print('Removing {} empty tags'.format(empty.count())) | |
19 | empty.delete() |
|
19 | empty.delete() |
General Comments 0
You need to be logged in to leave comments.
Login now