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

Strange behaviour with debug-toolbar and include #48

Open
sephii opened this issue Jul 14, 2017 · 0 comments
Open

Strange behaviour with debug-toolbar and include #48

sephii opened this issue Jul 14, 2017 · 0 comments

Comments

@sephii
Copy link

sephii commented Jul 14, 2017

I noticed a very strange behaviour when using an {% include %} statement along with the Django debug toolbar enabled. Django-widget-tweaks filters are ignored when using the following (_field.html just contains {{ field }}):

{% include "_field.html" with field=form.foo|attr:"title:hello" %}

While it works fine when using {{ field }} in the main template instead of the include statement or when disabling the debug toolbar. Maybe the widget is rendered by the Django debug toolbar before being rendered in the page, and the original as_widget method is put back before it's rendered again in the template.

I created a project here that demonstrates the bug: https://github.com/sephii/django-widget-tweaks-bug

Just pip install the requirements, run the server, and go to https://localhost:8000/, you'll see the field that's included doesn't have the "title" attribute.

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

No branches or pull requests

1 participant