diff --git a/biscuit/core/__init__.py b/biscuit/core/__init__.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..cae73705779c8c016e545c4d619449e5f88d4e3d 100644 --- a/biscuit/core/__init__.py +++ b/biscuit/core/__init__.py @@ -0,0 +1 @@ +default_app_config = 'biscuit.core.apps.CoreConfig' diff --git a/biscuit/core/apps.py b/biscuit/core/apps.py new file mode 100644 index 0000000000000000000000000000000000000000..b2afdd550c2eee96a5266775b847901067fa5be5 --- /dev/null +++ b/biscuit/core/apps.py @@ -0,0 +1,22 @@ +from glob import glob +import os + +from django.apps import AppConfig +from django.conf import settings +from django.utils.translation import gettext_lazy as _ + + +class CoreConfig(AppConfig): + name = 'biscuit.core' + verbose_name = _('BiscuIT - The Free School Information System') + + def clean_scss(self): + for source_map in glob(os.path.join(settings.STATIC_ROOT, '*.css.map')): + try: + os.unlink(source_map) + except OSError: + # Ignore because old is better than nothing + pass # noqa + + def ready(self): + self.clean_scss()