forked from CGM_Public/pretix_original
API: Fix crash in check-in API (PRETIXEU-CT1) (#5806)
This commit is contained in:
@@ -966,6 +966,7 @@ class CheckinRPCSearchView(ListAPIView):
|
|||||||
def get_serializer_context(self):
|
def get_serializer_context(self):
|
||||||
ctx = super().get_serializer_context()
|
ctx = super().get_serializer_context()
|
||||||
ctx['expand'] = self.request.query_params.getlist('expand')
|
ctx['expand'] = self.request.query_params.getlist('expand')
|
||||||
|
ctx['organizer'] = self.request.organizer
|
||||||
ctx['pdf_data'] = False
|
ctx['pdf_data'] = False
|
||||||
return ctx
|
return ctx
|
||||||
|
|
||||||
|
|||||||
@@ -932,6 +932,12 @@ def test_search(token_client, organizer, event, clist, clist_all, item, other_it
|
|||||||
assert resp.status_code == 200
|
assert resp.status_code == 200
|
||||||
assert [p1] == resp.data['results']
|
assert [p1] == resp.data['results']
|
||||||
|
|
||||||
|
with django_assert_max_num_queries(25):
|
||||||
|
resp = token_client.get(
|
||||||
|
'/api/v1/organizers/{}/checkinrpc/search/?list={}&search=z3fsn8jyu&expand=item'.format(organizer.slug, clist_all.pk))
|
||||||
|
assert resp.status_code == 200
|
||||||
|
assert resp.data['results'][0]['item']['name']
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.django_db
|
@pytest.mark.django_db
|
||||||
def test_search_no_list(token_client, organizer, event, clist, clist_all, item, other_item, order):
|
def test_search_no_list(token_client, organizer, event, clist, clist_all, item, other_item, order):
|
||||||
|
|||||||
Reference in New Issue
Block a user