Skip to content

Commit

Permalink
Fix codacy-found bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Roberto Alsina committed Apr 28, 2017
1 parent c4f8a3f commit 284eb11
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions nikola/nikola.py
Expand Up @@ -1686,16 +1686,20 @@ def register_shortcode(self, name, f):
self.shortcode_registry[name] = f

# XXX in v8, get rid of with_dependencies
def apply_shortcodes(self, data, filename=None, lang=None, with_dependencies=False, extra_context={}):
def apply_shortcodes(self, data, filename=None, lang=None, with_dependencies=False, extra_context=None):
"""Apply shortcodes from the registry on data."""
if extra_context is None:
extra_context = {}
if lang is None:
lang = utils.LocaleBorg().current_lang
return shortcodes.apply_shortcodes(data, self.shortcode_registry, self, filename, lang=lang, with_dependencies=with_dependencies, extra_context=extra_context)

def apply_shortcodes2(self, data, shortcodes, filename=None, lang=None, with_dependencies=False, extra_context={}):
def apply_shortcodes2(self, data, shortcodes, filename=None, lang=None, with_dependencies=False, extra_context=None):
"""Apply shortcodes from the registry on data."""
if lang is None:
lang = utils.LocaleBorg().current_lang
if extra_context is None:
extra_context = {}
deps = []
for k, v in shortcodes:
replacement, _deps = shortcodes.apply_shortcodes(v, self.shortcode_registry, self, filename, lang=lang, with_dependencies=with_dependencies, extra_context=extra_context)
Expand Down

0 comments on commit 284eb11

Please sign in to comment.