diff --git a/councilmatic_core/management/commands/data_integrity.py b/councilmatic_core/management/commands/data_integrity.py index aeeb16aa..c9e1c84a 100644 --- a/councilmatic_core/management/commands/data_integrity.py +++ b/councilmatic_core/management/commands/data_integrity.py @@ -18,7 +18,8 @@ class Command(BaseCommand): help = 'Checks for alignment between the Solr index and Councilmatic database' def handle(self, *args, **options): - councilmatic_count = Bill.objects.all().count() + + councilmatic_count = self.count_councilmatic_bills() try: solr_url = settings.HAYSTACK_CONNECTIONS['default']['URL'] @@ -40,3 +41,7 @@ def handle(self, *args, **options): logger.info('Good news! Solr index has {solr} entites. The Councilmatic database has {councilmatic} entities.'.format(solr=solr_index_count, councilmatic=councilmatic_count)) print('. . . . .\n') + + def count_councilmatic_bills(self): + + return Bill.objects.all().count() \ No newline at end of file