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

django_compressor killed my 'name' variable #156

Closed
peterbe opened this issue Nov 10, 2011 · 5 comments
Closed

django_compressor killed my 'name' variable #156

peterbe opened this issue Nov 10, 2011 · 5 comments
Milestone

Comments

@peterbe
Copy link
Contributor

peterbe commented Nov 10, 2011

My basic template looked something like this:

{% extends "base.html" %}
{% block body %} Hi {{ name }} {% endblock %}

All was fine until I added django_compressor. Now template context variable name becomes None.

I know that "name" is a poor choice of a variable but django_compressor shouldn't interfere anyway. Going to do some more debugging into django_compressor to confirm that this is the case. I changed from "name" to "foobar_name" (which is better anyway) and that solved my immediate problem.

@peterbe
Copy link
Contributor Author

peterbe commented Nov 10, 2011

Culprit: https://github.com/jezdez/django_compressor/blob/develop/compressor/templatetags/compress.py#L81

it's a much to generic name and too risky to squeeze in to the context.

@judy2k
Copy link

judy2k commented Nov 14, 2011

Just dropping a note to say that I also have this issue.

@jezdez
Copy link
Member

jezdez commented Nov 17, 2011

Agreed, this is kinda related to #151. A combined fix would be appreciated.

@judy2k
Copy link

judy2k commented Nov 17, 2011

I'm coding overflow the weekend. I'll see if I can pull together a fix.
Cheers Jannis!

This message was sent from my phone, so please excuse its brevity,
spelling, and punctuation.
On 17 Nov 2011 22:14, "Jannis Leidel" <
reply@reply.github.com>
wrote:

Agreed, this is kinda related to #151. A combined fix would be appreciated.


Reply to this email directly or view it on GitHub:
#156 (comment)

@judy2k
Copy link

judy2k commented Nov 17, 2011

I have no idea why my phone decided I meant overflow instead of over...

This message was sent from my phone, so please excuse its brevity,
spelling, and punctuation.
On 17 Nov 2011 22:16, "Mark Smith" mark.smith@practicalpoetry.co.uk wrote:

I'm coding overflow the weekend. I'll see if I can pull together a fix.
Cheers Jannis!

This message was sent from my phone, so please excuse its brevity,
spelling, and punctuation.
On 17 Nov 2011 22:14, "Jannis Leidel" <
reply@reply.github.com>
wrote:

Agreed, this is kinda related to #151. A combined fix would be
appreciated.


Reply to this email directly or view it on GitHub:

#156 (comment)

jezdez added a commit that referenced this issue Nov 24, 2011
…templates to prevent accidental overriding of context variables with common names (e.g. "name", "url", "content"). Fixes #150, #151, #156.
@jezdez jezdez closed this as completed Nov 24, 2011
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

3 participants