Permalink
Browse files

Avoid calling get_placeholder_conf multiple times when getting all pl…

…ugins (cms.plugin_pool.get_all_plugins).
  • Loading branch information...
1 parent aaa32ec commit 9214feaeadab4bff87718267f964c075a646f9cb @charettes charettes committed Aug 30, 2011
Showing with 5 additions and 5 deletions.
  1. +5 −5 cms/plugin_pool.py
View
@@ -77,14 +77,14 @@ def get_all_plugins(self, placeholder=None, page=None, setting_key="plugins", in
plugins = self.plugins.values()[:]
plugins.sort(key=lambda obj: unicode(obj.name))
final_plugins = []
+ allowed_plugins = get_placeholder_conf(
+ setting_key,
+ placeholder,
+ getattr(page, 'template', None)
+ )
for plugin in plugins:
include_plugin = False
if placeholder:
- allowed_plugins = get_placeholder_conf(
- setting_key,
- placeholder,
- getattr(page, 'template', None)
- )
if allowed_plugins:
if plugin.__name__ in allowed_plugins:
include_plugin = True

0 comments on commit 9214fea

Please sign in to comment.