Skip to content

Commit

Permalink
Fix depth and last approved filter test that wasn't updated
Browse files Browse the repository at this point in the history
  • Loading branch information
tw4l committed Feb 6, 2025
1 parent 0d7c74c commit 268c7cb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
12 changes: 4 additions & 8 deletions backend/btrixcloud/pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -546,10 +546,8 @@ async def list_pages(
if is_seed in (True, False):
query["isSeed"] = is_seed

# Check that field matches and value is an int to avoid 0
# from returning null results
if depth:
query["$and"] = [{"depth": depth}, {"depth": {"type": 16}}]
if isinstance(depth, int):
query["depth"] = depth

if reviewed:
query["$or"] = [
Expand Down Expand Up @@ -699,10 +697,8 @@ async def list_collection_pages(
if is_seed in (True, False):
query["isSeed"] = is_seed

# Check that field matches and value is an int to avoid 0
# from returning null results
if depth:
query["$and"] = [{"depth": depth}, {"depth": {"type": 16}}]
if isinstance(depth, int):
query["depth"] = depth

aggregate = [{"$match": query}]

Expand Down
2 changes: 1 addition & 1 deletion backend/test/test_run_crawl.py
Original file line number Diff line number Diff line change
Expand Up @@ -953,7 +953,7 @@ def test_crawl_pages_qa_filters(crawler_auth_headers, default_org_id, crawler_cr
headers=crawler_auth_headers,
)
assert r.status_code == 200
assert r.json()["total"] == 0
assert r.json()["total"] == 2


def test_re_add_crawl_pages(crawler_auth_headers, default_org_id, crawler_crawl_id):
Expand Down

0 comments on commit 268c7cb

Please sign in to comment.