Track total payments on any donation

static-cp-fix
Drew DeVault 9 years ago
parent 8d320c8820
commit 8f3c8017f1
  1. 1
      cronjob.py
  2. 2
      fosspay/objects.py

@ -40,6 +40,7 @@ for donation in donations:
send_thank_you(user, donation.amount, donation.type == DonationType.monthly)
donation.updated = datetime.now()
donation.payments += 1
db.commit()
else:
print("Skipping {}".format(donation))

@ -62,6 +62,7 @@ class Donation(Base):
updated = Column(DateTime, nullable=False)
comment = Column(String(512))
active = Column(Boolean)
payments = Column(Integer)
def __init__(self, user, type, amount, project=None, comment=None):
self.user = user
@ -73,6 +74,7 @@ class Donation(Base):
self.project = project
self.comment = comment
self.active = True
self.payments = 1
def __repr__(self):
return "<Donation {} from {}: ${} ({})>".format(

Loading…
Cancel
Save