Fix type error.

master
Tom Hacohen 4 years ago
parent 6f543751a6
commit df855897f8

@ -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

Loading…
Cancel
Save