Skip to content

Commit

Permalink
Merge pull request #2682 from getnikola/fix-2681
Browse files Browse the repository at this point in the history
Fix #2681 -- fix crashes when rendering subcategories
  • Loading branch information
Kwpolska committed Feb 26, 2017
2 parents ca1b235 + 7d837d7 commit c791467
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES.txt
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion nikola/plugins/task/categories.py
Expand Up @@ -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),
Expand Down

0 comments on commit c791467

Please sign in to comment.