Skip to content

Commit

Permalink
Warn developer when a template-tag package is bad
Browse files Browse the repository at this point in the history
Fixes #497.
  • Loading branch information
Chad Miller authored and cyberdelia committed Oct 12, 2015
1 parent c8c1b91 commit 988cf17
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pipeline/templatetags/pipeline.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from __future__ import unicode_literals

import logging

from django.contrib.staticfiles.storage import staticfiles_storage

from django import template
Expand All @@ -12,6 +14,7 @@
from ..packager import Packager, PackageNotFound
from ..utils import guess_type

logger = logging.getLogger(__name__)

register = template.Library()

Expand Down Expand Up @@ -73,6 +76,7 @@ def render(self, context):
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')

Expand Down Expand Up @@ -101,6 +105,7 @@ def render(self, context):
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')

Expand Down

0 comments on commit 988cf17

Please sign in to comment.