add a comment to clarify distinction betwen Ebookfile and Ebook

pull/1/head
Raymond Yee 2016-03-30 14:59:04 -07:00
parent a72ac07dcf
commit 182e784144
1 changed files with 1 additions and 0 deletions

View File

@ -522,6 +522,7 @@ class Campaign(models.Model):
self.problems.append(_('A buy-to-unglue campaign must have a target'))
may_launch = False
if self.type==THANKS:
# the case in which there is no EbookFile and no Ebook associated with work (We have ebooks without ebook files.)
if EbookFile.objects.filter(edition__work=self.work).count()==0 and self.work.ebooks().count()==0:
self.problems.append(_('You can\'t launch a thanks-for-ungluing campaign if you don\'t have any ebook files uploaded' ))
may_launch = False