Skip to content

Commit

Permalink
fix(court-dates): recalculating court dates can now handle courts wit…
Browse files Browse the repository at this point in the history
…h no documents yet
  • Loading branch information
jacksonj04 committed Sep 24, 2024
1 parent 1eeed60 commit 9c2ea33
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions judgments/management/commands/recalculate_court_dates.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,15 @@ def _get_year_of_first_document_in_order(self, canonical_court_param, order, doc
api_client, SearchParameters(court=canonical_court_param, order=order)
)

if len(search_response.results) == 0:
self.stdout.write(
self.style.WARNING(
f"Could not find document for court {canonical_court_param}, \
falling back to config value of {fallback}"
)
)
return fallback

first_document = search_response.results[0]

if first_document.date:
Expand Down

0 comments on commit 9c2ea33

Please sign in to comment.