Skip to content
Permalink
Browse files
Fix codacy-found bug
  • Loading branch information
ralsina committed Apr 28, 2017
1 parent c4f8a3f commit 284eb1147b1abae40eef727f78d2785d605b5784
Showing with 6 additions and 2 deletions.
  1. +6 −2 nikola/nikola.py
@@ -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)

0 comments on commit 284eb11

Please sign in to comment.