Skip to content

Commit

Permalink
Merge pull request #459 from bento-platform/features/remove-beacon-qu…
Browse files Browse the repository at this point in the history
…ery-censorship

remove censorship from search code for beacon
  • Loading branch information
gsfk committed Nov 21, 2023
2 parents 5b1d01d + 6c9c9a3 commit 9a2d73c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
3 changes: 0 additions & 3 deletions chord_metadata_service/patients/api_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,6 @@ class BeaconListIndividuals(APIView):
def filter_queryset(self, queryset):
# Check query parameters validity
qp = self.request.query_params
if len(qp) > settings.CONFIG_PUBLIC["rules"]["max_query_parameters"]:
raise ValidationError(f"Wrong number of fields: {len(qp)}")

search_conf = settings.CONFIG_PUBLIC["search"]
field_conf = settings.CONFIG_PUBLIC["fields"]
queryable_fields = {
Expand Down
4 changes: 2 additions & 2 deletions chord_metadata_service/patients/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -731,6 +731,6 @@ def test_beacon_search_response_invalid_search_value(self):
self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)

@override_settings(CONFIG_PUBLIC=CONFIG_PUBLIC_TEST)
def test_beacon_search_too_many_params(self):
def test_beacon_search_more_params_than_censorship_limit(self):
response = self.client.get('/api/beacon_search?sex=MALE&smoking=Non-smoker&death_dc=Deceased')
self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
self.assertEqual(response.status_code, status.HTTP_200_OK)

0 comments on commit 9a2d73c

Please sign in to comment.