0.5.19 fix next \ prev doc

This commit is contained in:
SDE
2024-07-18 13:33:46 +03:00
parent fb6676c468
commit 2a900c2726

View File

@@ -79,7 +79,9 @@ class DocArt(BaseModelViewPage):
if self.order:
kwargs['order__lt'] = self.order
art = DocArt.objects.filter(**kwargs).order_by('-order').first()
art = DocArt.objects.exclude(
id=self.id
).filter(**kwargs).order_by('-order').first()
if art:
while art.get_last_child(version=version):
@@ -106,7 +108,9 @@ class DocArt(BaseModelViewPage):
if self.order:
kwargs['order__gt'] = self.order
art = DocArt.objects.filter(**kwargs).order_by('order').first()
art = DocArt.objects.exclude(
id=self.id
).filter(**kwargs).order_by('order').first()
if not art and self.parent:
art = DocArt.objects.filter(