Skip to content

Commit 9dcd192

Browse files
matthiaskowais
authored andcommitted
Avoid the assignment_tag deprecation warning (django-webpack#88)
django-countries does it the same way, see SmileyChris/django-countries@0477bdb56
1 parent dbf0329 commit 9dcd192

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

webpack_loader/templatetags/webpack_loader.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from django import template
1+
from django import template, VERSION
22
from django.conf import settings
33
from django.utils.safestring import mark_safe
44

@@ -50,7 +50,8 @@ def webpack_static(asset_name, config='DEFAULT'):
5050
)
5151

5252

53-
@register.assignment_tag
53+
assignment_tag = register.simple_tag if VERSION >= (1, 9) else register.assignment_tag
54+
@assignment_tag
5455
def get_files(bundle_name, extension=None, config='DEFAULT'):
5556
"""
5657
Returns all chunks in the given bundle.

0 commit comments

Comments
 (0)