Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
django-pipeline
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
django-pipeline
Commits
988cf17e
Commit
988cf17e
authored
Sep 13, 2015
by
Chad Miller
Committed by
Timothée Peignier
Oct 12, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Warn developer when a template-tag package is bad
Fixes #497.
parent
c8c1b91d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
+5
-0
pipeline/templatetags/pipeline.py
+5
-0
No files found.
pipeline/templatetags/pipeline.py
View file @
988cf17e
from
__future__
import
unicode_literals
from
__future__
import
unicode_literals
import
logging
from
django.contrib.staticfiles.storage
import
staticfiles_storage
from
django.contrib.staticfiles.storage
import
staticfiles_storage
from
django
import
template
from
django
import
template
...
@@ -12,6 +14,7 @@ from ..conf import settings
...
@@ -12,6 +14,7 @@ from ..conf import settings
from
..packager
import
Packager
,
PackageNotFound
from
..packager
import
Packager
,
PackageNotFound
from
..utils
import
guess_type
from
..utils
import
guess_type
logger
=
logging
.
getLogger
(
__name__
)
register
=
template
.
Library
()
register
=
template
.
Library
()
...
@@ -73,6 +76,7 @@ class StylesheetNode(PipelineMixin, template.Node):
...
@@ -73,6 +76,7 @@ class StylesheetNode(PipelineMixin, template.Node):
try
:
try
:
package
=
self
.
package_for
(
package_name
,
'css'
)
package
=
self
.
package_for
(
package_name
,
'css'
)
except
PackageNotFound
:
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
''
# fail silently, do not return anything if an invalid group is specified
return
self
.
render_compressed
(
package
,
'css'
)
return
self
.
render_compressed
(
package
,
'css'
)
...
@@ -101,6 +105,7 @@ class JavascriptNode(PipelineMixin, template.Node):
...
@@ -101,6 +105,7 @@ class JavascriptNode(PipelineMixin, template.Node):
try
:
try
:
package
=
self
.
package_for
(
package_name
,
'js'
)
package
=
self
.
package_for
(
package_name
,
'js'
)
except
PackageNotFound
:
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
''
# fail silently, do not return anything if an invalid group is specified
return
self
.
render_compressed
(
package
,
'js'
)
return
self
.
render_compressed
(
package
,
'js'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment