Skip to content

Commit

Permalink
Added support for Django 4.1 through 5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ataylor32 committed May 21, 2024
1 parent 3a6dfe1 commit 12d05f4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
Changes
=======

Unreleased
----------------

- Added support for Django 4.1 through 5.0

1.3.1 (2018-08-14)
------------------

Expand Down
8 changes: 4 additions & 4 deletions src/friendlytagloader/templatetags/friendly_loader.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from django.template import Library, TemplateSyntaxError
from django.template import Library, NodeList, TemplateSyntaxError

try:
from django.template.base import TokenType
Expand All @@ -8,8 +8,8 @@
else:
TOKEN_BLOCK = TokenType.BLOCK

from django.template.defaulttags import (CommentNode, IfNode, LoadNode,
find_library, load_from_library)
from django.template.defaulttags import (IfNode, LoadNode, find_library,
load_from_library)
from django.template.smartif import Literal

register = Library()
Expand Down Expand Up @@ -89,7 +89,7 @@ def do_if_has_tag(parser, token, negate=False):
end_tag = 'end%s' % bits[0]
has_tag = all([tag in parser.tags for tag in bits[1:]])
has_tag = (not negate and has_tag) or (negate and not has_tag)
nodelist_true = nodelist_false = CommentNode()
nodelist_true = nodelist_false = NodeList()
if has_tag:
nodelist_true = parser.parse(('else', end_tag))
token = parser.next_token()
Expand Down

0 comments on commit 12d05f4

Please sign in to comment.