Skip to content

Commit

Permalink
Remove redundant check for similarity in tags, it is covered by the t…
Browse files Browse the repository at this point in the history
…axonomy classifier
  • Loading branch information
ralsina committed Jul 25, 2018
1 parent b7632e5 commit 55d4420
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
1 change: 1 addition & 0 deletions CHANGES.txt
Expand Up @@ -20,6 +20,7 @@ Bugfixes
non-default language (Issue #3112)
* Implement ``MARKDOWN_EXTENSION_CONFIGS`` properly (Issue #2970)
* Ignore ``.DS_Store`` when processing listings (Issue #3099)
* Remove redundant check for tag similarity (Mentioned in Issue #3123)

New in v8.0.0b2 (changes since Beta 1)
======================================
Expand Down
11 changes: 1 addition & 10 deletions nikola/nikola.py
Expand Up @@ -2111,16 +2111,7 @@ def scan_posts(self, really=False, ignore_quit=False, quiet=False):
for lang in self.config['TRANSLATIONS'].keys():
for tag in post.tags_for_language(lang):
_tag_slugified = utils.slugify(tag, lang)
if _tag_slugified in slugged_tags[lang]:
if tag not in self.posts_per_tag:
# Tags that differ only in case
other_tag = [existing for existing in self.posts_per_tag.keys() if utils.slugify(existing, lang) == _tag_slugified][0]
utils.LOGGER.error('You have tags that are too similar: {0} and {1}'.format(tag, other_tag))
utils.LOGGER.error('Tag {0} is used in: {1}'.format(tag, post.source_path))
utils.LOGGER.error('Tag {0} is used in: {1}'.format(other_tag, ', '.join([p.source_path for p in self.posts_per_tag[other_tag]])))
quit = True
else:
slugged_tags[lang].add(_tag_slugified)
slugged_tags[lang].add(_tag_slugified)
if post not in self.posts_per_tag[tag]:
self.posts_per_tag[tag].append(post)
self.tags_per_language[lang].extend(post.tags_for_language(lang))
Expand Down

0 comments on commit 55d4420

Please sign in to comment.