X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/8ae7c36dcdaa17301f8085b69b003d513ffcfa1f..90f3cd6c555c7e976016b1d0cdda1e68b098764a:/apps/catalogue/models.py
diff --git a/apps/catalogue/models.py b/apps/catalogue/models.py
index 486172a2c..30131bdbf 100644
--- a/apps/catalogue/models.py
+++ b/apps/catalogue/models.py
@@ -111,6 +111,8 @@ class Book(models.Model):
formats.append(u'Plik PDF' % self.pdf_file.url)
if self.odt_file:
formats.append(u'Plik ODT' % self.odt_file.url)
+ if self.odt_file:
+ formats.
self._short_html = unicode(render_to_string('catalogue/book_short.html',
{'book': self, 'tags': tags, 'formats': formats}))
@@ -154,6 +156,7 @@ class Book(models.Model):
raise Book.AlreadyExists('Book %s already exists' % book_slug)
book.title = book_info.title
+ book._short_html = ''
book.save()
book_tags = []