Commit 988cf17e by Chad Miller Committed by Timothée Peignier

Warn developer when a template-tag package is bad

Fixes #497.
parent c8c1b91d
from __future__ import unicode_literals
import logging
from django.contrib.staticfiles.storage import staticfiles_storage
from django import template
......@@ -12,6 +14,7 @@ from ..conf import settings
from ..packager import Packager, PackageNotFound
from ..utils import guess_type
logger = logging.getLogger(__name__)
register = template.Library()
......@@ -73,6 +76,7 @@ class StylesheetNode(PipelineMixin, template.Node):
try:
package = self.package_for(package_name, 'css')
except PackageNotFound:
logger.warn("Package %r is unknown. Check PIPELINE_CSS in your settings.", package_name)
return '' # fail silently, do not return anything if an invalid group is specified
return self.render_compressed(package, 'css')
......@@ -101,6 +105,7 @@ class JavascriptNode(PipelineMixin, template.Node):
try:
package = self.package_for(package_name, 'js')
except PackageNotFound:
logger.warn("Package %r is unknown. Check PIPELINE_JS in your settings.", package_name)
return '' # fail silently, do not return anything if an invalid group is specified
return self.render_compressed(package, 'js')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment