Added a progress bar for verbosity=1 of the community list index update command.
- Legacy-Id: 17414
This commit is contained in:
parent
6300c359b4
commit
50e8918a56
|
@ -1,9 +1,10 @@
|
|||
# Copyright The IETF Trust 2019, All Rights Reserved
|
||||
# Copyright The IETF Trust 2019-2020, All Rights Reserved
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
|
||||
from __future__ import absolute_import, print_function, unicode_literals
|
||||
|
||||
from tqdm import tqdm
|
||||
|
||||
from django.core.management.base import BaseCommand
|
||||
|
||||
|
@ -23,7 +24,8 @@ class Command(BaseCommand):
|
|||
|
||||
|
||||
def handle(self, *args, **options):
|
||||
for rule in SearchRule.objects.filter(rule_type='name_contains'):
|
||||
verbosity = options.get('verbosity', 1)
|
||||
for rule in tqdm(SearchRule.objects.filter(rule_type='name_contains'), disable=(verbosity!=1)):
|
||||
count1 = rule.name_contains_index.count()
|
||||
if not options['dry_run']:
|
||||
reset_name_contains_index_for_rule(rule)
|
||||
|
|
Loading…
Reference in a new issue