From df855897f8a4d9fb1d1501d87b7ae3a585aa7256 Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Sun, 27 Dec 2020 15:26:36 +0200 Subject: [PATCH] Fix type error. --- etebase_fastapi/stoken_handler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etebase_fastapi/stoken_handler.py b/etebase_fastapi/stoken_handler.py index 9ea1500..fb89651 100644 --- a/etebase_fastapi/stoken_handler.py +++ b/etebase_fastapi/stoken_handler.py @@ -38,7 +38,7 @@ def get_queryset_stoken(queryset: list) -> t.Optional[Stoken]: for row in queryset: rowmaxid = getattr(row, "max_stoken") or -1 maxid = max(maxid, rowmaxid) - new_stoken = (maxid >= 0) and Stoken.objects.get(id=maxid) + new_stoken = Stoken.objects.get(id=maxid) if (maxid >= 0) else None return new_stoken or None