summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSerghei MIHAI <smihai@entrouvert.com>2013-12-31 10:20:56 (GMT)
committerSerghei MIHAI <smihai@entrouvert.com>2013-12-31 10:20:56 (GMT)
commit6813853a273d9af4e55875fbf24309f165f7ea89 (patch)
treea113f5e7b478a94095dfb079ffa8c0c08aa643ea
parentda33884cd28f7b2d1f1fcd0c04fb256e383522e3 (diff)
downloadcms-ajax-text-plugin-6813853a273d9af4e55875fbf24309f165f7ea89.zip
cms-ajax-text-plugin-6813853a273d9af4e55875fbf24309f165f7ea89.tar.gz
cms-ajax-text-plugin-6813853a273d9af4e55875fbf24309f165f7ea89.tar.bz2
plugin's parent render method called only in edit or ajax modes
-rw-r--r--cms_plugins.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/cms_plugins.py b/cms_plugins.py
index 96eb85b..a1d8285 100644
--- a/cms_plugins.py
+++ b/cms_plugins.py
@@ -13,12 +13,12 @@ class AjaxTextPlugin(TextPlugin):
return t.render(context)
def render(self, context, instance, placeholder):
- context = super(AjaxTextPlugin, self).render(context, instance, placeholder)
- context['object'] = instance
request = context.get('request')
edit_mode = request and 'edit' in request.GET
is_ajax = request and request.is_ajax()
+ context['object'] = instance
if edit_mode or is_ajax:
+ context = super(AjaxTextPlugin, self).render(context, instance, placeholder)
return context
context['body'] = self.get_ajax_body(instance, context)