mirror of
https://github.com/Hopiu/wagtail.git
synced 2026-03-16 22:10:28 +00: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:
parent
44564ea76a
commit
beb8f8bc4e
2 changed files with 32 additions and 0 deletions
|
|
@ -1,5 +1,7 @@
|
|||
from django.apps import AppConfig
|
||||
|
||||
from . import checks # NOQA
|
||||
|
||||
|
||||
class WagtailAdminAppConfig(AppConfig):
|
||||
name = 'wagtail.wagtailadmin'
|
||||
|
|
|
|||
30
wagtail/wagtailadmin/checks.py
Normal file
30
wagtail/wagtailadmin/checks.py
Normal 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
|
||||
Loading…
Reference in a new issue