Ignore non-CORE equity payments when importing from CORE

hopefully a good idea..?
This commit is contained in:
Lance Edgar 2023-09-07 20:58:35 -05:00
parent 01cbffe5a8
commit bf74ba8108

View file

@ -285,6 +285,17 @@ class MemberEquityPaymentImporter(FromCOREPOS, corepos_importing.model.MemberEqu
query=query,
key=key)
def cache_query(self):
query = super().cache_query()
model = self.model
# ignore existing payments not known to be in CORE
# TODO: is this in fact a good idea?
query = query.join(model.CoreMemberEquityPayment)\
.filter(model.CoreMemberEquityPayment.corepos_transaction_number != None)
return query
def get_member(self, card_number):
if hasattr(self, 'members_by_card_number'):
return self.members_by_card_number.get(card_number)