From c5c6196597c2e3935dc4324bd56dd7fa3576d7b1 Mon Sep 17 00:00:00 2001 From: Erik Stein Date: Tue, 2 Apr 2019 11:06:01 +0200 Subject: [PATCH] Again better template_name handling. --- content_plugins/base.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/content_plugins/base.py b/content_plugins/base.py index 8dcf265..2830bfd 100644 --- a/content_plugins/base.py +++ b/content_plugins/base.py @@ -98,8 +98,9 @@ class TemplateRendererPlugin(BasePlugin): class FilesystemTemplateRendererPlugin(TemplateRendererPlugin): - template_name_prefix = '' - template_name = '' + # Don't define template_name_prefix here, so that a sibling class takes precedence + # template_name_prefix = '' + # template_name = '' class Meta: abstract = True @@ -118,7 +119,7 @@ class FilesystemTemplateRendererPlugin(TemplateRendererPlugin): then super's template names, finally prefixed _default.html. """ - if not self.template_name: + if not getattr(self, 'template_name', False): raise ImproperlyConfigured( "FilesystemTemplateRendererPlugin requires either a definition of " "'template_name' or an implementation of 'get_template_names()'")