X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/1c32b7e62b938bc49d77718a629a5ff194c6a099..4d63dddcde34ef242f0f4283adc39ff04737a9c6:/src/catalogue/views.py?ds=sidebyside diff --git a/src/catalogue/views.py b/src/catalogue/views.py index e71895f0d..847831d69 100644 --- 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,))) - 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