Skip to content
This repository has been archived by the owner on May 14, 2024. It is now read-only.

Commit

Permalink
fix: bundles list view Request-URI Too Long error (#197)
Browse files Browse the repository at this point in the history
There could be a lot of bundles, so we can't use query params
because it will raise the "Request-URI Too Long" error. Use the
request data in such case.
  • Loading branch information
dyudyunov authored Apr 25, 2023
1 parent d34ba92 commit a2c2259
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions blockstore/apps/rest_api/v1/views/bundles.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ class BundleFilter(FilterSet):
"""
Filter for BundleViewSet.
"""
def __init__(self, data=None, queryset=None, *, request=None, prefix=None):
# There could be a lot of bundles, so we can't use query params because it will
# raise the "Request-URI Too Long" error. Use the request data in such case.
# NOTE: query_params (data arg) have a higher priority than the request.data
data = data or request.data or {}
super().__init__(data, queryset, request=request, prefix=prefix)

uuid = AllValuesMultipleFilter(widget=CSVWidget) # Accepts multiple comma-separated UUIDs
text_search = CharFilter(method='search')

Expand Down

0 comments on commit a2c2259

Please sign in to comment.