Skip to content

Commit 7f97ef6

Browse files
committed
Fixing: Deprecation warnings when used with Django 1.9
1 parent 7d783ad commit 7f97ef6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

bootstrapform/templatetags/bootstrap.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from django import forms
1+
from django import forms, VERSION as django_version
22
from django.template import Context
33
from django.template.loader import get_template
44
from django import template
@@ -77,6 +77,9 @@ def render(element, markup_classes):
7777
template = get_template("bootstrapform/form.html")
7878
context = Context({'form': element, 'classes': markup_classes})
7979

80+
if django_version >= (1, 8):
81+
context = context.flatten()
82+
8083
return template.render(context)
8184

8285

0 commit comments

Comments
 (0)