Fix a TypeError raised by a thanks campaign with no ebook

https://docs.djangoproject.com/en/1.9/releases/1.7/#templates
pull/1/head
eric 2016-07-25 13:15:53 -04:00
parent cd9e2cf8ea
commit 06d240f5e4
1 changed files with 5 additions and 1 deletions

View File

@ -1332,7 +1332,11 @@ class Work(models.Model):
if(campaign.status == 'SUCCESSFUL'):
status = 6
elif(campaign.status == 'ACTIVE'):
target = float(campaign.target)
if campaign.target is not None:
target = float(campaign.target)
else:
#shouldn't happen, but did once because of a failed pdf conversion
return 0
if target <= 0:
status = 6
else: