Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Iterate over nodes and templates using nodelist #105

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lvoytek
Copy link

@lvoytek lvoytek commented Aug 22, 2023

When iterating over Template and Node objects directly, nodes may fail with an exception such as:
TypeError: 'TextNode' object is not iterable
This is due to iterating over nodes being unsupported in Django, as noted in https://code.djangoproject.com/ticket/7430
To avoid this error, explicitly iterate over the nodelist attribute, rather than relying on iter.

This fixes the issue seen in #101

When iterating over Template and Node objects directly, nodes may fail with an
exception such as:
TypeError: 'TextNode' object is not iterable
This is due to iterating over nodes being unsupported in Django, as noted in
https://code.djangoproject.com/ticket/7430
To avoid this error, explicitly iterate over the nodelist attribute, rather
than relying on __iter__.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant