Ah, right, a book with no chapters...

This commit is contained in:
Zergling_man 2021-10-29 05:05:42 +11:00
parent 55f160cb73
commit a403aa7375

View File

@ -9,7 +9,8 @@ class Book(models.Model):
@property
def last_updated(self):
return Chapter.objects.filter(book=self).order_by('added')[0].added
chaps=Chapter.objects.filter(book=self).order_by('added')
return chaps[0].added if chaps else None
def __str__(self):
return self.title