From 3dfe5c92628d4c41d89dbd89f753b7485da0eeeb Mon Sep 17 00:00:00 2001 From: jonaswinkler <17569239+jonaswinkler@users.noreply.github.com> Date: Sat, 3 Apr 2021 21:50:23 +0200 Subject: [PATCH] fix page out of range with full text --- src/documents/views.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/documents/views.py b/src/documents/views.py index f61933e16..71b01cdd6 100755 --- a/src/documents/views.py +++ b/src/documents/views.py @@ -17,6 +17,7 @@ from django_filters.rest_framework import DjangoFilterBackend from django_q.tasks import async_task from rest_framework import parsers from rest_framework.decorators import action +from rest_framework.exceptions import NotFound from rest_framework.filters import OrderingFilter, SearchFilter from rest_framework.generics import GenericAPIView from rest_framework.mixins import ( @@ -382,6 +383,8 @@ class UnifiedSearchViewSet(DocumentViewSet): with index.open_index_searcher() as s: self.searcher = s return super(UnifiedSearchViewSet, self).list(request) + except NotFound: + raise except Exception as e: return HttpResponseBadRequest(str(e)) else: