Skip to content
Permalink
Browse files

Merge pull request #2682 from getnikola/fix-2681

Fix #2681 -- fix crashes when rendering subcategories
  • Loading branch information
Kwpolska committed Feb 26, 2017
2 parents ca1b235 + 7d837d7 commit c791467f93f286d2323048445c70870d5790f460
Showing with 2 additions and 1 deletion.
  1. +1 −0 CHANGES.txt
  2. +1 −1 nikola/plugins/task/categories.py
@@ -18,6 +18,7 @@ Features
Bugfixes
--------

* Fix crashes when rendering subcategories (Issue #2681)
* Prevent writing cache files outside of the cache folder
(Issue #2684)
* Fix mimetype guessing in auto mode (Issue #2645)
@@ -170,7 +170,7 @@ def provide_context_and_uptodate(self, cat, lang, node=None):
}
posts = self.site.posts_per_classification[self.classification_name][lang]
children = [child for child in node.children if len([post for post in posts.get(child.classification_name, []) if self.site.config['SHOW_UNTRANSLATED_POSTS'] or post.is_translation_available(lang)]) > 0]
subcats = [(child.name, self.site.link(self.classification_name, child.classification_name, lang), child.classification_name, child.classification_path) for child in children]
subcats = [(child.name, self.site.link(self.classification_name, child.classification_name, lang)) for child in children]
friendly_name = self.get_classification_friendly_name(cat, lang)
context = {
"title": self.site.config['CATEGORY_PAGES_TITLES'].get(lang, {}).get(cat, self.site.MESSAGES[lang]["Posts about %s"] % friendly_name),

0 comments on commit c791467

Please sign in to comment.