Skip to content

Commit 988cf17

Browse files
Chad Millercyberdelia
authored andcommitted
Warn developer when a template-tag package is bad
Fixes #497.
1 parent c8c1b91 commit 988cf17

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pipeline/templatetags/pipeline.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
from __future__ import unicode_literals
22

3+
import logging
4+
35
from django.contrib.staticfiles.storage import staticfiles_storage
46

57
from django import template
@@ -12,6 +14,7 @@
1214
from ..packager import Packager, PackageNotFound
1315
from ..utils import guess_type
1416

17+
logger = logging.getLogger(__name__)
1518

1619
register = template.Library()
1720

@@ -73,6 +76,7 @@ def render(self, context):
7376
try:
7477
package = self.package_for(package_name, 'css')
7578
except PackageNotFound:
79+
logger.warn("Package %r is unknown. Check PIPELINE_CSS in your settings.", package_name)
7680
return '' # fail silently, do not return anything if an invalid group is specified
7781
return self.render_compressed(package, 'css')
7882

@@ -101,6 +105,7 @@ def render(self, context):
101105
try:
102106
package = self.package_for(package_name, 'js')
103107
except PackageNotFound:
108+
logger.warn("Package %r is unknown. Check PIPELINE_JS in your settings.", package_name)
104109
return '' # fail silently, do not return anything if an invalid group is specified
105110
return self.render_compressed(package, 'js')
106111

0 commit comments

Comments
 (0)