Skip to content

Commit

Permalink
Merge pull request #509 from carltongibson/develop
Browse files Browse the repository at this point in the history
Version 0.15.2
  • Loading branch information
Carlton Gibson committed Sep 29, 2016
2 parents a96f93a + e40e45e commit 783940d
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.15.1
current_version = 0.15.2
commit = False
tag = False
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\-(?P<release>[a-z]+))?
Expand Down
7 changes: 7 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@

Version 0.15.2 (2016-09-29)
---------------------------

* #507 Fix compatibility issue when not using the DTL


Version 0.15.1 (2016-09-28)
---------------------------

Expand Down
2 changes: 1 addition & 1 deletion django_filters/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from .filterset import FilterSet
from .filters import *

__version__ = '0.15.1'
__version__ = '0.15.2'


def parse_version(version):
Expand Down
6 changes: 3 additions & 3 deletions django_filters/rest_framework/backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@

if compat.is_crispy:
template_path = 'django_filters/rest_framework/crispy_form.html'
template_default = Template(CRISPY_TEMPLATE)
template_default = CRISPY_TEMPLATE

else:
template_path = 'django_filters/rest_framework/form.html'
template_default = Template(FILTER_TEMPLATE)
template_default = FILTER_TEMPLATE


class DjangoFilterBackend(BaseFilterBackend):
Expand Down Expand Up @@ -84,7 +84,7 @@ def to_html(self, request, queryset, view):
try:
template = loader.get_template(self.template)
except TemplateDoesNotExist:
template = template_default
template = Template(template_default)

return template_render(template, context={
'filter': filter_instance
Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@
# built documents.
#
# The short X.Y version.
version = '0.15.1'
version = '0.15.2'
# The full version, including alpha/beta/rc tags.
release = '0.15.1'
release = '0.15.2'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
readme = f.read()
f.close()

version = '0.15.1'
version = '0.15.2'

if sys.argv[-1] == 'publish':
if os.system("pip freeze | grep wheel"):
Expand Down
12 changes: 12 additions & 0 deletions tests/rest_framework/test_backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

from django_filters import filters
from django_filters.rest_framework import DjangoFilterBackend, FilterSet
from django_filters.rest_framework import backends

from .models import BaseFilterableItem, BasicModel, FilterableItem, DjangoFilterOrderingModel

Expand Down Expand Up @@ -327,6 +328,17 @@ class Backend(view.filter_backends[0]):

self.assertHTMLEqual(html, "Test")

@override_settings(TEMPLATES=[])
def test_DTL_missing(self):
# The backend should be importable even if the DTL is not used.
# See: https://github.com/carltongibson/django-filter/issues/506
try:
from importlib import reload # python 3.4
except ImportError:
from imp import reload

reload(backends)


@override_settings(ROOT_URLCONF='tests.rest_framework.test_backends')
class IntegrationTestDetailFiltering(CommonFilteringTestCase):
Expand Down

0 comments on commit 783940d

Please sign in to comment.