Sith/core/scss/storage.py

41 lines
1.3 KiB
Python
Raw Normal View History

2017-05-05 12:26:46 +00:00
#!/usr/bin/env python3
2023-04-06 11:08:42 +00:00
# -*- coding:utf-8 -*-
2017-05-05 12:26:46 +00:00
#
2023-04-06 11:08:42 +00:00
# Copyright 2023 © AE UTBM
# ae@utbm.fr / ae.info@utbm.fr
# All contributors are listed in the CONTRIBUTORS file.
2017-05-05 12:26:46 +00:00
#
2023-04-06 11:08:42 +00:00
# This file is part of the website of the UTBM Student Association (AE UTBM),
# https://ae.utbm.fr.
2017-05-05 12:26:46 +00:00
#
2023-04-06 11:08:42 +00:00
# You can find the whole source code at https://github.com/ae-utbm/sith3
2017-05-05 12:26:46 +00:00
#
2023-04-06 11:08:42 +00:00
# LICENSED UNDER THE GNU GENERAL PUBLIC LICENSE VERSION 3 (GPLv3)
# SEE : https://raw.githubusercontent.com/ae-utbm/sith3/master/LICENSE
# OR WITHIN THE LOCAL FILE "LICENSE"
2017-05-05 12:26:46 +00:00
#
2023-04-06 11:08:42 +00:00
# PREVIOUSLY LICENSED UNDER THE MIT LICENSE,
# SEE : https://raw.githubusercontent.com/ae-utbm/sith3/master/LICENSE.old
# OR WITHIN THE LOCAL FILE "LICENSE.old"
2017-05-05 12:26:46 +00:00
#
from django.conf import settings
from django.contrib.staticfiles.finders import get_finders
from django.core.files.storage import FileSystemStorage
class ScssFileStorage(FileSystemStorage):
def __init__(self, location=None, base_url=None, *args, **kwargs):
if location is None:
location = settings.STATIC_ROOT
if base_url is None:
base_url = settings.STATIC_URL
super(ScssFileStorage, self).__init__(location, base_url, *args, **kwargs)
def find_file(path):
for finder in get_finders():
result = finder.find(path)
if result:
return result