[Django 1.9] Update template.base.Library() import
Adds a wrapper for Django 1.9 for the usage of the Library() function, as the import path has changed. Change-Id: I93c37bfaef6bc29c85d2e6a570cf552d685f711e Partially-implements: blueprint drop-dj17
This commit is contained in:
parent
1305ccf561
commit
94515a0720
@ -10,11 +10,15 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from django.template import base
|
||||
import django
|
||||
from django import template
|
||||
from django.template import defaultfilters
|
||||
from django.utils import safestring
|
||||
|
||||
register = base.Library()
|
||||
if django.VERSION >= (1, 9):
|
||||
register = template.Library()
|
||||
else:
|
||||
register = template.base.Library()
|
||||
|
||||
|
||||
@register.filter(is_safe=True)
|
||||
|
Loading…
Reference in New Issue
Block a user