We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9979adb commit 4d7976aCopy full SHA for 4d7976a
pupa/utils/fulltext.py
@@ -92,15 +92,10 @@ def bill_to_elasticsearch(bill):
92
for other_title in bill.other_titles.all():
93
es_bill['titles'].append(other_title.title)
94
95
- # Recursively retrieve all organizations that the bill is related to
96
- es_bill['organizations'] = []
97
organization = bill.from_organization
98
- while True:
99
- try:
100
- es_bill['organizations'].append(organization.name)
101
- except AttributeError:
102
- break
103
- organization = organization.parent
+ es_bill['organizations'] = [organization.name, ]
+ for ancestor in organization.get_parents():
+ es_bill['organizations'].append(ancestor.name)
104
105
es_bill['sponsors'] = []
106
for sponsor in bill.sponsorships.all().filter(bill=bill):
0 commit comments