Skip to content

Commit

Permalink
Merge pull request #390 from nationalarchives/FCL-55-press-summary-ne…
Browse files Browse the repository at this point in the history
…utral-citation

Neutral citation in search results includes press summaries.
  • Loading branch information
dragon-dxw authored Sep 18, 2023
2 parents 01ea57b + f1a8273 commit 7d0b36e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/caselawclient/responses/search_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,15 +172,17 @@ def uri(self) -> DocumentURIString:
@property
def neutral_citation(self) -> str:
"""
:return: The neutral citation of the search result
:return: The neutral citation of the search result, or the judgment it is a press summary of.
"""

return self._get_xpath_match_string("search:extracted/uk:cite/text()")
return self._get_xpath_match_string(
"search:extracted/uk:cite/text()"
) or self._get_xpath_match_string("search:extracted/akn:neutralCitation/text()")

@property
def name(self) -> str:
"""
:return: The neutral citation of the search result
:return: The title of the search result's document
"""

return self._get_xpath_match_string("search:extracted/akn:FRBRname/@value")
Expand Down

0 comments on commit 7d0b36e

Please sign in to comment.