Skip to content

Commit f073313

Browse files
committed
Be sure key is a str
1 parent 44816b1 commit f073313

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/webstack_django_sorting/templatetags/sorting_tags.py

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

33
from django import template
44
from django.http import Http404
@@ -67,7 +67,7 @@ def __init__(
6767
self.null_ordering = null_ordering
6868

6969
def render(self, context: Context) -> str:
70-
key = self.context_var if self.context_var is not None else self.queryset_var.var
70+
key: str = self.context_var if self.context_var is not None else str(self.queryset_var.var)
7171

7272
queryset = self.queryset_var.resolve(context)
7373
order_by = common.get_order_by_from_request(context["request"])

0 commit comments

Comments
 (0)