From 71c0dda0df1dc5e814b2ceb7b47c7da464a1cc99 Mon Sep 17 00:00:00 2001 From: Gustavo Andres Morero Date: Thu, 9 Aug 2018 11:08:36 -0300 Subject: [PATCH] update for Django 2.1 support. --- pagination/templatetags/pagination_tags.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pagination/templatetags/pagination_tags.py b/pagination/templatetags/pagination_tags.py index 1a635c4..47588d5 100644 --- a/pagination/templatetags/pagination_tags.py +++ b/pagination/templatetags/pagination_tags.py @@ -4,7 +4,7 @@ except NameError: from sets import Set as set from django import template -from django.template.base import TOKEN_BLOCK +from django.template.base import TokenType from django.http import Http404 from django.core.paginator import Paginator, InvalidPage from django.conf import settings @@ -23,7 +23,7 @@ def do_autopaginate(parser, token): """ # Check whether there are any other autopaginations are later in this template - expr = lambda obj: (obj.token_type == TOKEN_BLOCK and \ + expr = lambda obj: (obj.token_type == TokenType.BLOCK.value and \ len(obj.split_contents()) > 0 and obj.split_contents()[0] == "autopaginate") multiple_paginations = len(list(filter(expr, parser.tokens))) > 0 -- 2.43.0