diff --git a/.gitignore b/.gitignore index 560c3a09..9fa1d001 100644 --- a/.gitignore +++ b/.gitignore @@ -26,3 +26,4 @@ npm-debug.log package-lock.json local.sqlite +.coverage* diff --git a/src/djangocms_snippet/templatetags/snippet_tags.py b/src/djangocms_snippet/templatetags/snippet_tags.py index 5bb506b0..119b5685 100644 --- a/src/djangocms_snippet/templatetags/snippet_tags.py +++ b/src/djangocms_snippet/templatetags/snippet_tags.py @@ -69,6 +69,8 @@ def render(self, context: BaseContext) -> str: """ # Default assume this is directly an instance snippet_instance = self.snippet_id_varname.resolve(context) + + response = self.nodelist.render(context) # Assume this is slug with exceptionless(self.parse_until): if isinstance(snippet_instance, str): @@ -77,10 +79,12 @@ def render(self, context: BaseContext) -> str: elif isinstance(snippet_instance, int): # pragma: no cover snippet_instance = Snippet.objects.get(pk=snippet_instance) - return mark_safe( + response = mark_safe( self.get_content_render(context, snippet_instance) ) + return response + def get_content_render( self, context: BaseContext, instance: Snippet ) -> str: