From 939ff0827b3fd2ea044cccefe3e0061f3f059c15 Mon Sep 17 00:00:00 2001 From: Matt Westcott Date: Fri, 28 Aug 2015 10:13:25 +0100 Subject: [PATCH] Turn snippet_type_name into a class method --- wagtail/wagtailsnippets/edit_handlers.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/wagtail/wagtailsnippets/edit_handlers.py b/wagtail/wagtailsnippets/edit_handlers.py index 8a7370401..f1c5e2886 100644 --- a/wagtail/wagtailsnippets/edit_handlers.py +++ b/wagtail/wagtailsnippets/edit_handlers.py @@ -19,7 +19,7 @@ class BaseSnippetChooserPanel(BaseChooserPanel): @classmethod def widget_overrides(cls): return {cls.field_name: AdminSnippetChooser( - content_type=cls.target_content_type(), snippet_type_name=cls.snippet_type_name)} + content_type=cls.target_content_type(), snippet_type_name=cls.get_snippet_type_name())} @classmethod def target_content_type(cls): @@ -46,12 +46,12 @@ class BaseSnippetChooserPanel(BaseChooserPanel): return mark_safe(render_to_string(self.field_template, { 'field': self.bound_field, self.object_type_name: instance_obj, - 'snippet_type_name': self.snippet_type_name, + 'snippet_type_name': self.get_snippet_type_name(), })) - @property - def snippet_type_name(self): - return force_text(self.target_content_type()._meta.verbose_name) + @classmethod + def get_snippet_type_name(cls): + return force_text(cls.target_content_type()._meta.verbose_name) class SnippetChooserPanel(object):