From 4d9de045120fb7f08675e52a5ed4b3e55dc2c7ef Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Wed, 25 Sep 2019 13:22:24 +0200 Subject: [PATCH 1/1] Fix for Django < 1.10. --- fnp_django_pagination/__init__.py | 2 +- fnp_django_pagination/middleware.py | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/fnp_django_pagination/__init__.py b/fnp_django_pagination/__init__.py index ec778ac..fe60da6 100644 --- a/fnp_django_pagination/__init__.py +++ b/fnp_django_pagination/__init__.py @@ -34,4 +34,4 @@ tools throughout a django application. """ -__version__ = (2, 2, 3, "final", 0) +__version__ = (2, 2, 4, "final", 0) diff --git a/fnp_django_pagination/middleware.py b/fnp_django_pagination/middleware.py index 02f8e7c..bb33c4a 100644 --- a/fnp_django_pagination/middleware.py +++ b/fnp_django_pagination/middleware.py @@ -28,7 +28,11 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -from django.utils.deprecation import MiddlewareMixin +try: + from django.utils.deprecation import MiddlewareMixin +except ImportError: + # Django < 1.10 + MiddlewareMixin = object def get_page(self, suffix): -- 2.20.1