diff --git a/pupa/importers/bills.py b/pupa/importers/bills.py index 0a732f1..5cc1665 100644 --- a/pupa/importers/bills.py +++ b/pupa/importers/bills.py @@ -1,3 +1,5 @@ +from django.db.models import Q + from opencivicdata.legislative.models import ( Bill, RelatedBill, @@ -114,9 +116,12 @@ def postimport(self): ): candidates = list( Bill.objects.filter( - legislative_session__identifier=rb.legislative_session, - legislative_session__jurisdiction_id=self.jurisdiction_id, - identifier=rb.identifier, + 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: diff --git a/pupa/importers/vote_events.py b/pupa/importers/vote_events.py index 41fa15a..be144a0 100644 --- a/pupa/importers/vote_events.py +++ b/pupa/importers/vote_events.py @@ -98,9 +98,7 @@ def prepare_for_db(self, data): date=data["start_date"], organization_id=data["organization_id"], ) - # seen_action_ids is for ones being added in this import - # action.vote is already set if action was set on prior import - if action.id in self.seen_action_ids or hasattr(action, "vote"): + if action.id in self.seen_action_ids: self.warning( "can not match two VoteEvents to %s: %s", action.id, bill_action )