Handle None

This commit is contained in:
Drew DeVault 2016-08-06 18:34:39 -04:00
parent 1b81d867ea
commit 2e1b9c7883
1 changed files with 2 additions and 1 deletions

View File

@ -71,10 +71,11 @@ class Donation(Base):
self.created = datetime.now()
self.updated = datetime.now()
self.emailed_about = False
self.project_id = project.id
self.comment = comment
self.active = True
self.payments = 1
if project:
self.project_id = project.id
def __repr__(self):
return "<Donation {} from {}: ${} ({})>".format(