tangentlabs/django-oscar — pull request #605 by elbaschid (2013-03-27 01:13:50+00:00)
Title: Fixing less compilation in sandbox and during offline compression

The changes made in #546, once more, caused issue with using
offline compression functionality in django-compressor. I looked
at the templates again and found a solution that actually accommodates
both by moving the ``use_less`` flag into the ``compress`` block and
passing the ``USE_LESS`` setting into the ``COMPRESS_OFFLINE_CONTEXT``.

The reason for that is in the way django-compressor works. It basically
parses **all** templates that it can find for compress blocks,
disregarding inheritance. This means even overriding the ``styles`` will
cause compressor to try and compress both the LESS and CSS files. However,
compressor provides a specific context when rendering the compress nodes
during offline compression. So moving the ``USE_LESS`` flag into the
compress context does the trick.

I have also added a small section to the docs explaining the setitngs for
someone using offline compression, like we do.

@codeinthehole can you please take a look at this soon, as this is
causing problems in the deployment of multiple project. If you disagree
with this fix, we need to find another way.