Skip to content

Commit

Permalink
Merge pull request #506 from aih/feature/428-sap
Browse files Browse the repository at this point in the history
#428 sap identical bill propagation
  • Loading branch information
aih authored Jul 29, 2021
2 parents e3999ef + 2ae77dc commit 308b8a0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion server_py/flatgov/bills/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,12 @@ def get_context_data(self, **kwargs):

def get_related_statements(self, **kwargs):
slug = self.kwargs['slug']
return Statement.objects.filter(bill_number__iexact=slug[3:]).filter(
bill_numbers = []
bill_numbers.append(slug[3:])
[bill_numbers.append(number[3:]) for number in self.identical_bill_numbers if number[3:] not in bill_numbers]
q_list = map(lambda n: Q(bill_number__iexact=n), bill_numbers)
q_list = reduce(lambda a, b: a | b, q_list)
return Statement.objects.filter(q_list).filter(
congress__iexact=slug[:3])

def get_related_committees(self, **kwargs):
Expand Down

0 comments on commit 308b8a0

Please sign in to comment.