Skip to content

Commit 6992c5e

Browse files
author
Rocky Meza
committed
Move the make ASSETS_ROOT dir call to somewhere useful.
1 parent 7ecf33d commit 6992c5e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

django_pyscss/compressor.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from compressor.filters import FilterBase
66
from compressor.conf import settings
77

8-
from django_pyscss.scss import DjangoScss, config
8+
from django_pyscss.scss import DjangoScss
99

1010

1111
class DjangoScssFilter(FilterBase):
@@ -26,7 +26,5 @@ def __init__(self, content, attrs=None, filter_type=None, filename=None):
2626
self.relative_to = os.path.dirname(href.replace(settings.STATIC_URL, ''))
2727

2828
def input(self, **kwargs):
29-
if not os.path.exists(config.ASSETS_ROOT):
30-
os.makedirs(config.ASSETS_ROOT)
3129
return self.compiler.compile(scss_string=self.content,
3230
relative_to=self.relative_to)

django_pyscss/scss.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,8 @@ def Compilation(self, scss_string=None, scss_file=None, super_selector=None,
151151
Overwritten to call _find_source_file instead of
152152
SourceFile.from_filename. Also added the relative_to option.
153153
"""
154+
if not os.path.exists(config.ASSETS_ROOT):
155+
os.makedirs(config.ASSETS_ROOT)
154156
if super_selector:
155157
self.super_selector = super_selector + ' '
156158
self.reset()

0 commit comments

Comments
 (0)