fnp
/
wolnelektury.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix #3667: poprawa wyświetlanania losowych przykładów w katalogach tagów
[wolnelektury.git]
/
src
/
catalogue
/
views.py
diff --git
a/src/catalogue/views.py
b/src/catalogue/views.py
index
e71895f
..
847831d
100644
(file)
--- a/
src/catalogue/views.py
+++ b/
src/catalogue/views.py
@@
-712,8
+712,10
@@
def tag_catalogue(request, category):
else:
tags = list(get_top_level_related_tags((), categories=(category,)))
else:
tags = list(get_top_level_related_tags((), categories=(category,)))
- if len(tags) > 3:
- best = random.sample(tags, 3)
+ tags = [tag for tag in tags if tag.description]
+
+ if len(tags) > 4:
+ best = random.sample(tags, 4)
else:
best = tags
else:
best = tags