Skip to content
Browse files

if possible, reuse the placeholder that is already there instead of r…

…efetching it from the DB
  • Loading branch information...
1 parent 7bbe551 commit b51bd7445424bf34271d4ba4d0290d83a9b89f71 @piquadrat piquadrat committed Jul 25, 2012
Showing with 3 additions and 5 deletions.
  1. +3 −5 cms/models/pluginmodel.py
View
8 cms/models/pluginmodel.py
@@ -166,11 +166,9 @@ def get_plugin_instance(self, admin=None):
def render_plugin(self, context=None, placeholder=None, admin=False, processors=None):
instance, plugin = self.get_plugin_instance()
if instance and not (admin and not plugin.admin_preview):
- if isinstance(placeholder, Placeholder):
- placeholder_slot = placeholder.slot
- else:
- placeholder_slot = placeholder or instance.placeholder.slot
- placeholder = instance.placeholder
+ if not isinstance(placeholder, Placeholder):
+ placeholder = instance.placeholder
+ placeholder_slot = placeholder.slot
context = PluginContext(context, instance, placeholder)
context = plugin.render(context, instance, placeholder_slot)
if plugin.render_plugin:

0 comments on commit b51bd74

Please sign in to comment.
Something went wrong with that request. Please try again.