Skip to content

Commit

Permalink
[Minor] Use boolean type for checking boolean query string
Browse files Browse the repository at this point in the history
  • Loading branch information
gzurowski committed Sep 16, 2024
1 parent a0cd7f1 commit 19861f8
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -679,11 +679,11 @@ def test_get_unified_documents(self, request):
def get_unified_documents(self, request):
is_anonymous = request.user.is_anonymous
query_params = request.query_params
subscribed_hubs = query_params.get("subscribed_hubs", "false")
subscribed_hubs = query_params.get("subscribed_hubs", "false").lower() == "true"

Check warning on line 682 in src/researchhub_document/views/researchhub_unified_document_views.py

View check run for this annotation

Codecov / codecov/patch

src/researchhub_document/views/researchhub_unified_document_views.py#L682

Added line #L682 was not covered by tests
filtering = query_params.get("ordering", HOT)
time_scope = query_params.get("time", "today")

if subscribed_hubs == "true" and not is_anonymous:
if subscribed_hubs and not is_anonymous:

Check warning on line 686 in src/researchhub_document/views/researchhub_unified_document_views.py

View check run for this annotation

Codecov / codecov/patch

src/researchhub_document/views/researchhub_unified_document_views.py#L686

Added line #L686 was not covered by tests
return self._get_subscribed_unified_documents(request)

document_request_type = query_params.get("type", "all")
Expand Down

0 comments on commit 19861f8

Please sign in to comment.