Merge pull request #82 from hugoleodev/master
Fixing: Deprecation warnings when used with Django 1.9 #77
This commit is contained in:
commit
ab0b59e913
@ -1,4 +1,4 @@
|
||||
from django import forms
|
||||
from django import forms, VERSION as django_version
|
||||
from django.template import Context
|
||||
from django.template.loader import get_template
|
||||
from django import template
|
||||
@ -77,6 +77,9 @@ def render(element, markup_classes):
|
||||
template = get_template("bootstrapform/form.html")
|
||||
context = Context({'form': element, 'classes': markup_classes})
|
||||
|
||||
if django_version >= (1, 8):
|
||||
context = context.flatten()
|
||||
|
||||
return template.render(context)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user