Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixing collision check.
  • Loading branch information
felixfontein committed Nov 30, 2016
1 parent ccffbd3 commit 26b4a12
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions nikola/plugins/misc/taxonomies_classifier.py
Expand Up @@ -46,11 +46,8 @@ class TaxonomiesClassifier(SignalHandler):
def _do_classification(self, site):
# Get list of enabled taxonomy plugins
taxonomies = self.site.taxonomy_plugins.values()
# Prepare classification and check for collisions
site.posts_per_classification = {}
for taxonomy in taxonomies:
if taxonomy.classification_name in site.posts_per_classification:
raise Exception("Found more than one taxonomy with classification name '{}'!".format(taxonomy.classification_name))
site.posts_per_classification[taxonomy.classification_name] = {
lang: defaultdict(set) for lang in site.config['TRANSLATIONS'].keys()
}
Expand Down Expand Up @@ -314,5 +311,7 @@ def set_site(self, site):
for taxonomy in [p.plugin_object for p in site.plugin_manager.getPluginsOfCategory('Taxonomy')]:
if not taxonomy.is_enabled():
continue
if taxonomy.classification_name in site.taxonomy_plugins:
raise Exception("Found more than one taxonomy with classification name '{}'!".format(taxonomy.classification_name))
site.taxonomy_plugins[taxonomy.classification_name] = taxonomy
self._register_path_handlers(taxonomy)

0 comments on commit 26b4a12

Please sign in to comment.