Skip to content

Commit

Permalink
Totally dropped Context() usage, bump to 0.6.4
Browse files Browse the repository at this point in the history
  • Loading branch information
sveetch committed Jul 28, 2017
1 parent 8b6f25f commit a03cd13
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion crispy_forms_foundation/__init__.py
@@ -1,2 +1,2 @@
"""Django application to add 'django-crispy-forms' layout objects for 'Foundation for sites'""" # noqa: E501
__version__ = '0.6.3'
__version__ = '0.6.4'
16 changes: 4 additions & 12 deletions crispy_forms_foundation/layout/buttons.py
Expand Up @@ -11,7 +11,6 @@
* `Foundation 6 Button Group <http://foundation.zurb.com/sites/docs/button-group.html>`_;
""" # noqa: E501
from django.template import Context
from django.template.loader import render_to_string

from crispy_forms.utils import render_field, TEMPLATE_PACK
Expand Down Expand Up @@ -100,17 +99,10 @@ def render(self, form, form_style, context, template_pack=TEMPLATE_PACK):
template_pack=template_pack)
)

try:
buttons = render_to_string(template, Context({
'buttongroup': self,
'field_list': field_list,
}))
except TypeError:
# From Django 1.11 render_to_string doesn't want a Context object
buttons = render_to_string(template, {
'buttongroup': self,
'field_list': field_list,
})
buttons = render_to_string(template, {
'buttongroup': self,
'field_list': field_list,
})

return buttons

Expand Down
6 changes: 6 additions & 0 deletions docs/changelog.rst
Expand Up @@ -4,6 +4,12 @@
Changelog
=========

Version 0.6.4 - 2017/07/29
**************************

* Fixed ``layout.buttons.ButtonGroup`` for deprecated ``Context()`` usage;
* Fixed tests that performs comparison on html part using ``django.test.html.parse_html``;

Version 0.6.3 - 2017/07/16
**************************

Expand Down
2 changes: 2 additions & 0 deletions docs/index.rst
Expand Up @@ -61,6 +61,7 @@ Contributors
.. _`@sbaechler`: https://github.com/sbaechler
.. _`@bionikspoon`: https://github.com/bionikspoon
.. _`@flesser`: https://github.com/flesser
.. _`@xbello`: https://github.com/xbello

* Philip Garnero (`@PhilipGarnero`_);
* Juerg Rast (`@jrast`_);
Expand All @@ -69,3 +70,4 @@ Contributors
* Simon Bächler (`@sbaechler`_);
* Manu Phatak (`@bionikspoon`_);
* Florian Eßer (`@flesser`_);
* Xabier Bello (`@xbello`_);

0 comments on commit a03cd13

Please sign in to comment.