Skip to content

Commit

Permalink
fix(recap): Fix append rd created and tweak docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
albertisfu committed Jan 6, 2025
1 parent 35c9536 commit 3388e05
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cl/recap/mergers.py
Original file line number Diff line number Diff line change
Expand Up @@ -823,10 +823,10 @@ async def get_or_make_docket_entry(


async def keep_latest_rd_document(queryset: QuerySet) -> RECAPDocument:
"""Removes duplicate RECAPDocuments, keeping the most recent with PDF if
available or otherwise the most recent overall.
"""Retains the most recent item with a PDF, if available otherwise,
retains the most recent item overall.
:param params: RECAPDocument QuerySet to clean duplicates from.
:param queryset: RECAPDocument QuerySet to clean duplicates from.
:return: The matched RECAPDocument after cleaning.
"""
rd_with_pdf_queryset = queryset.filter(is_available=True).exclude(
Expand Down Expand Up @@ -981,10 +981,10 @@ async def add_docket_entries(
is_available=False,
**params,
)
rds_created.append(rd)
except ValidationError:
# Happens from race conditions.
continue
rds_created.append(rd)
except RECAPDocument.MultipleObjectsReturned:
logger.info(
"Multiple recap documents found for document entry number'%s' "
Expand Down

0 comments on commit 3388e05

Please sign in to comment.