Squashed commit of the following:

commit 75e46b8023
Author: smilerz <smilerz@gmail.com>
Date:   Wed Aug 25 21:27:31 2021 -0500

    fix #883

commit 2a1e1953ee
Author: smilerz <smilerz@gmail.com>
Date:   Wed Aug 25 21:08:35 2021 -0500

    consolidated recently viewed into FTS queryset

commit aa2d0eafb1
Author: smilerz <smilerz@gmail.com>
Date:   Wed Aug 25 16:43:52 2021 -0500

    fixed cookie reactivity

commit b74fdb3825
Author: smilerz <smilerz@gmail.com>
Date:   Wed Aug 25 16:37:43 2021 -0500

    exact match appears first on keyword/food/unit searches

commit b00c189fd6
Author: smilerz <smilerz@gmail.com>
Date:   Wed Aug 25 16:36:14 2021 -0500

    add pagination reset on search query change
This commit is contained in:
smilerz
2021-08-25 22:19:42 -05:00
parent 07a67684ab
commit ba07e98cae
6 changed files with 40 additions and 52 deletions

View File

@ -12,7 +12,7 @@ from django.contrib.auth.models import User
from django.contrib.postgres.search import TrigramSimilarity
from django.core.exceptions import FieldError, ValidationError
from django.core.files import File
from django.db.models import Q, Case, When, Value
from django.db.models import Case, Q, Value, When
from django.db.models.fields.related import ForeignObjectRel
from django.http import FileResponse, HttpResponse, JsonResponse
from django_scopes import scopes_disabled
@ -483,7 +483,7 @@ class RecipePagination(PageNumberPagination):
max_page_size = 100
def paginate_queryset(self, queryset, request, view=None):
self.facets = get_facet(queryset, request.query_params, request.space)
self.facets = get_facet(queryset, request)
return super().paginate_queryset(queryset, request, view)
def get_paginated_response(self, data):