0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-11-30 01:46:24 +01:00

Add system check to confirm that compiled CSS files are present.

Fixes #1720. Thanks to Shu Ishida for initial development on this feature.
This commit is contained in:
Matt Westcott 2015-12-15 18:44:09 +00:00 committed by Karl Hobley
parent 44564ea76a
commit beb8f8bc4e
2 changed files with 32 additions and 0 deletions

View File

@ -1,5 +1,7 @@
from django.apps import AppConfig
from . import checks # NOQA
class WagtailAdminAppConfig(AppConfig):
name = 'wagtail.wagtailadmin'

View File

@ -0,0 +1,30 @@
import os
from django.core.checks import Error, register
@register()
def css_install_check(app_configs, **kwargs):
errors = []
css_path = os.path.join(
os.path.dirname(__file__), 'static', 'wagtailadmin', 'css', 'normalize.css'
)
if not os.path.isfile(css_path):
error_hint = """
Most likely you are running a development (non-packaged) copy of
Wagtail and have not built the static assets -
see http://docs.wagtail.io/en/latest/contributing/developing.html
File not found: %s
""" % css_path
errors.append(
Error(
"CSS for the Wagtail admin is missing",
hint=error_hint,
id='wagtailadmin.E001',
)
)
return errors