Skip to content

Commit

Permalink
Always call super for plugins render method
Browse files Browse the repository at this point in the history
  • Loading branch information
yakky committed Jun 16, 2015
1 parent 5b20302 commit 78b074f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions djangocms_blog/cms_plugins.py
Expand Up @@ -27,7 +27,7 @@ class BlogLatestEntriesPlugin(BlogPlugin):
cache = False

def render(self, context, instance, placeholder):
context['instance'] = instance
context = super(BlogLatestEntriesPlugin, self).render(context, instance, placeholder)
context['posts_list'] = instance.get_posts(context['request'])
context['TRUNCWORDS_COUNT'] = get_setting('POSTS_LIST_TRUNCWORDS_COUNT')
context['placeholder'] = placeholder
Expand All @@ -45,7 +45,7 @@ class BlogLatestEntriesPluginCached(BlogPlugin):
filter_horizontal = ('categories',)

def render(self, context, instance, placeholder):
context['instance'] = instance
context = super(BlogLatestEntriesPluginCached, self).render(context, instance, placeholder)
context['posts_list'] = instance.get_posts()
context['TRUNCWORDS_COUNT'] = get_setting('POSTS_LIST_TRUNCWORDS_COUNT')
context['placeholder'] = placeholder
Expand All @@ -61,7 +61,7 @@ class BlogAuthorPostsPlugin(BlogPlugin):
filter_horizontal = ['authors']

def render(self, context, instance, placeholder):
context['instance'] = instance
context = super(BlogAuthorPostsPlugin, self).render(context, instance, placeholder)
context['authors_list'] = instance.get_authors()
return context

Expand All @@ -73,6 +73,7 @@ class BlogTagsPlugin(BlogPlugin):
render_template = 'djangocms_blog/plugins/tags.html'

def render(self, context, instance, placeholder):
context = super(BlogTagsPlugin, self).render(context, instance, placeholder)
context['tags'] = Post.objects.tag_cloud(queryset=Post.objects.published())
return context

Expand All @@ -84,6 +85,7 @@ class BlogCategoryPlugin(BlogPlugin):
render_template = 'djangocms_blog/plugins/categories.html'

def render(self, context, instance, placeholder):
context = super(BlogCategoryPlugin, self).render(context, instance, placeholder)
context['categories'] = BlogCategory.objects.all()
return context

Expand All @@ -95,6 +97,7 @@ class BlogArchivePlugin(BlogPlugin):
render_template = 'djangocms_blog/plugins/archive.html'

def render(self, context, instance, placeholder):
context = super(BlogArchivePlugin, self).render(context, instance, placeholder)
context['dates'] = Post.objects.get_months(queryset=Post.objects.published())
return context

Expand Down

0 comments on commit 78b074f

Please sign in to comment.