Python3.5 compat

This commit is contained in:
Rollo Konig Brock 2021-03-31 16:28:27 +01:00
parent 91f9677f57
commit 99bd5b0e1f

View File

@ -875,7 +875,7 @@ class CursorPagination(BasePagination):
pk_name = queryset.model._meta.pk.name
# Always include a unique key to order by
if not {f"-{pk_name}", pk_name, "pk", "-pk"} & set(ordering):
if not {"-{}".format(pk_name), pk_name, "pk", "-pk"} & set(ordering):
ordering = tuple(ordering) + (pk_name,)
return tuple(ordering)