Skip to content

Commit 0c31731

Browse files
Kegan HoltzhausenKegan Holtzhausen
authored andcommitted
moved get_fallback_languages out of the if statement
1 parent d9aff9f commit 0c31731

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

cms/plugin_rendering.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,8 @@ def render_placeholder(placeholder, context_to_copy, name_fallback="Placeholder"
113113
plugins = [plugin for plugin in get_plugins(request, placeholder, lang=lang)]
114114
# If no plugin is present in the current placeholder we loop in the fallback languages
115115
# and get the first available set of plugins
116-
if (len(plugins) == 0 and placeholder and get_fallback_languages(lang) and
116+
fallbacks = get_fallback_languages(lang)
117+
if (len(plugins) == 0 and placeholder and fallbacks and
117118
get_placeholder_conf("language_fallback", placeholder.slot, template, False)):
118119
fallbacks = get_fallback_languages(lang)
119120
for fallback_language in fallbacks:

0 commit comments

Comments
 (0)