Skip to content

Commit

Permalink
Helper function in data_integrity (#237)
Browse files Browse the repository at this point in the history
* Add argument to specify child class of bill

* Add helper class for counting bills
  • Loading branch information
reginafcompton authored Mar 1, 2019
1 parent 7ceb67b commit d693733
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion councilmatic_core/management/commands/data_integrity.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand All @@ -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()

0 comments on commit d693733

Please sign in to comment.