Fix type error.

This commit is contained in:
Tom Hacohen committed 2020-12-27 20:32:09 +02:00
1 parent 6f543751a6
commit df855897f8
1 file changed
+1 -1
+1 -1
View File
@@ -38,7 +38,7 @@ def get_queryset_stoken(queryset: list) -> t.Optional[Stoken]:
for row in queryset: for row in queryset:
rowmaxid = getattr(row, "max_stoken") or -1 rowmaxid = getattr(row, "max_stoken") or -1
maxid = max(maxid, rowmaxid) 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 return new_stoken or None