Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(recap.mergers): Update PACER attachment processing #4665

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions cl/recap/mergers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1658,9 +1658,23 @@ async def merge_attachment_page_data(
.afirst()
)
else:
main_rd = await RECAPDocument.objects.select_related(
"docket_entry", "docket_entry__docket"
).aget(**params)
try:
main_rd = await RECAPDocument.objects.select_related(
"docket_entry", "docket_entry__docket"
).aget(**params)
except RECAPDocument.DoesNotExist as exc:
# In cases where we have "doppelgänger" dockets drop pacer
# case id and check if the docket exists once more.
if params.get("docket_entry__docket__pacer_case_id"):
retry_params = params.copy()
retry_params.pop(
"docket_entry__docket__pacer_case_id", None
)
main_rd = await RECAPDocument.objects.select_related(
"docket_entry", "docket_entry__docket"
).aget(**retry_params)
else:
raise exc
except RECAPDocument.MultipleObjectsReturned as exc:
if pacer_case_id:
duplicate_rd_queryset = RECAPDocument.objects.filter(**params)
Expand Down