Skip to content

Commit

Permalink
black
Browse files Browse the repository at this point in the history
  • Loading branch information
fgregg committed Jul 23, 2023
1 parent c5b56fe commit be77910
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
19 changes: 12 additions & 7 deletions pupa/importers/bills.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,18 @@ def postimport(self):
# go through all RelatedBill objs that are attached to a bill in this
# jurisdiction and are currently unresolved
for rb in RelatedBill.objects.filter(
bill__legislative_session__jurisdiction_id=self.jurisdiction_id,
related_bill=None):
candidates = list(Bill.objects.filter(
Q(legislative_session__identifier=rb.legislative_session,
legislative_session__jurisdiction_id=self.jurisdiction_id),
Q(identifier=rb.identifier) |
Q(other_identifiers__identifier=rb.identifier))
bill__legislative_session__jurisdiction_id=self.jurisdiction_id,
related_bill=None,
):
candidates = list(
Bill.objects.filter(
Q(
legislative_session__identifier=rb.legislative_session,
legislative_session__jurisdiction_id=self.jurisdiction_id,
),
Q(identifier=rb.identifier)
| Q(other_identifiers__identifier=rb.identifier),
)
)
if len(candidates) == 1:
rb.related_bill = candidates[0]
Expand Down
5 changes: 3 additions & 2 deletions pupa/importers/vote_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,9 @@ def prepare_for_db(self, data):
organization_id=data["organization_id"],
)
if action.id in self.seen_action_ids:
self.warning('can not match two VoteEvents to %s: %s',
action.id, bill_action)
self.warning(
"can not match two VoteEvents to %s: %s", action.id, bill_action
)
else:
data["bill_action_id"] = action.id
self.seen_action_ids.add(action.id)
Expand Down

0 comments on commit be77910

Please sign in to comment.