torchbox/django-libsass

static function adding quotes seems wrong

k-funk opened this issue · 1 comments

This seems wrong: https://github.com/torchbox/django-libsass/blob/master/django_libsass.py#L19

This doesn't allow me to concatenate paths/use variables in conjunction with the static function, because double quotes end up in the middle of the string.

In django templates, users have to explicitly add wrapping quotes where they want them, for good reason: <img src="{% static "my_app/example.jpg" %}">.

Thanks for the report @k-funk! I think you're right - the quoting is unnecessary and breaks any string processing that happens afterwards, so I've removed it in 56d7fe5. (Having said that, though, performing string processing on the result of static probably isn't something people should be doing - it returns a full URL, potentially including query strings etc depending on how Django is configured, so concatenating paths to it won't be valid in general. Better to do the path-hacking first and then pass the result to static.)