Skip to content

Commit 50e8918

Browse files
committed
Added a progress bar for verbosity=1 of the community list index update command.
- Legacy-Id: 17414
1 parent 6300c35 commit 50e8918

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

ietf/utils/management/commands/update_community_list_index.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
# Copyright The IETF Trust 2019, All Rights Reserved
1+
# Copyright The IETF Trust 2019-2020, All Rights Reserved
22
# -*- coding: utf-8 -*-
33

44

55
from __future__ import absolute_import, print_function, unicode_literals
66

7+
from tqdm import tqdm
78

89
from django.core.management.base import BaseCommand
910

@@ -23,7 +24,8 @@ def add_arguments(self, parser):
2324

2425

2526
def handle(self, *args, **options):
26-
for rule in SearchRule.objects.filter(rule_type='name_contains'):
27+
verbosity = options.get('verbosity', 1)
28+
for rule in tqdm(SearchRule.objects.filter(rule_type='name_contains'), disable=(verbosity!=1)):
2729
count1 = rule.name_contains_index.count()
2830
if not options['dry_run']:
2931
reset_name_contains_index_for_rule(rule)

0 commit comments

Comments
 (0)