django-render-block icon indicating copy to clipboard operation
django-render-block copied to clipboard

Handles edge case where custom template tag defines child_nodelist at…

Open topher235 opened this issue 1 year ago • 0 comments

…tr as None

Absolutely love the library. I've recently discovered django-render-block is incompatible with django-slippers.

When a template tag is encountered before finding our desired block and that template tag defines its child_nodelist attributes as None, the rendering blows up here since None is not iterable.

Since standard Django procedure is to create an empty NodeList and extend it when parsing, I'd say the onus of this should be put on the custom template tag definition to not set child nodelists to None. And I have opened a PR in the django-slippers repo as well. That said, I can't think of a side effect of including this here and it does handle the edge case where the attribute is explicitly defined as None.

topher235 avatar Jul 31 '23 20:07 topher235