Skip to content

Commit 08d6c0c

Browse files
committed
default_sort_order has only two possible values
1 parent f073313 commit 08d6c0c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/webstack_django_sorting/templatetags/sorting_tags.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import Literal, cast
1+
from typing import Literal
22

33
from django import template
44
from django.http import Http404
@@ -116,7 +116,9 @@ def anchor(parser: Parser, token: Token) -> SortAnchorNode:
116116
except IndexError:
117117
title = bits[1].capitalize()
118118

119-
default_sort_order = "desc" if len(bits) >= 4 and bits[3].strip("'\"") == "desc" else "asc"
119+
default_sort_order: Literal["asc", "desc"] = (
120+
"desc" if len(bits) >= 4 and bits[3].strip("'\"") == "desc" else "asc"
121+
)
120122

121123
return SortAnchorNode(
122124
bits[1].strip(),

0 commit comments

Comments
 (0)