python models: Supporter.supporter_type() handles untagged payments.
This commit is contained in:
parent
e2eab732ac
commit
8481bbf3b9
1 changed files with 6 additions and 1 deletions
|
@ -112,7 +112,12 @@ class Supporter:
|
|||
return expose_wrapper
|
||||
|
||||
def _supporter_type(self, payments):
|
||||
return payments.last().program.rsplit(':', 1)[-1]
|
||||
for payment in payments.reverse():
|
||||
if payment.program is not None:
|
||||
break
|
||||
else:
|
||||
return None
|
||||
return payment.program.rsplit(':', 1)[-1]
|
||||
supporter_type = _expose(_supporter_type)
|
||||
|
||||
def _calculate_lapse_date(self, last_payment_date, supporter_type):
|
||||
|
|
Loading…
Reference in a new issue