fnp
/
wolnelektury.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixed book count fix
[wolnelektury.git]
/
apps
/
catalogue
/
models.py
diff --git
a/apps/catalogue/models.py
b/apps/catalogue/models.py
index
2097e17
..
e85462e
100644
(file)
--- a/
apps/catalogue/models.py
+++ b/
apps/catalogue/models.py
@@
-134,7
+134,7
@@
class Book(models.Model):
key = '_short_html_%s' % get_language()
short_html = getattr(self, key)
key = '_short_html_%s' % get_language()
short_html = getattr(self, key)
- if len(short_html):
+ if
short_html and
len(short_html):
return mark_safe(short_html)
else:
tags = self.tags.filter(~Q(category__in=('set', 'theme', 'book')))
return mark_safe(short_html)
else:
tags = self.tags.filter(~Q(category__in=('set', 'theme', 'book')))
@@
-345,7
+345,7
@@
class Fragment(models.Model):
def short_html(self):
key = '_short_html_%s' % get_language()
short_html = getattr(self, key)
def short_html(self):
key = '_short_html_%s' % get_language()
short_html = getattr(self, key)
- if len(short_html):
+ if
short_html and
len(short_html):
return mark_safe(short_html)
else:
book_authors = [mark_safe(u'<a href="%s">%s</a>' % (tag.get_absolute_url(), tag.name))
return mark_safe(short_html)
else:
book_authors = [mark_safe(u'<a href="%s">%s</a>' % (tag.get_absolute_url(), tag.name))