diff --git a/data-pipeline/bcreg/bcreg_lear.py b/data-pipeline/bcreg/bcreg_lear.py index ec9ec06..56ddb7a 100644 --- a/data-pipeline/bcreg/bcreg_lear.py +++ b/data-pipeline/bcreg/bcreg_lear.py @@ -373,7 +373,7 @@ def get_unprocessed_corps(self, last_event_id, last_event_dt): party_roles_version roles WHERE businesses.id = roles.business_id AND roles.party_id = parties.id - AND parties.party_type = 'organization' and roles.role in ('proprietor','partner') + AND parties.party_type = 'organization' and roles.role in ('proprietor') AND (parties.identifier = %s OR roles.business_id = (select id from businesses where identifier = %s))""" new_corps = [] @@ -817,7 +817,7 @@ def get_lear_relationship_info(self, corp_info): """ + self.get_table_prefix() + """party_roles_version roles WHERE businesses.id = roles.business_id AND roles.party_id = parties.id - AND parties.party_type = 'organization' and roles.role in ('proprietor','partner') + AND parties.party_type = 'organization' and roles.role in ('proprietor') AND (parties.identifier = """ + self.get_db_sql_param() + """ OR roles.business_id = (select id from """ + self.get_table_prefix() + """businesses where identifier = """ + self.get_db_sql_param() + """)) """