From 776bb60c3d1d47595b4556bfdd96fde0287fde41 Mon Sep 17 00:00:00 2001 From: Ebru Yucesar Date: Mon, 10 Jun 2024 08:51:40 -0400 Subject: [PATCH] map additional fields to legal doc --- web/main/legal_document_sources.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/web/main/legal_document_sources.py b/web/main/legal_document_sources.py index d5ac3b823..0eb1ccd99 100644 --- a/web/main/legal_document_sources.py +++ b/web/main/legal_document_sources.py @@ -524,8 +524,8 @@ def header_template(legal_document): class CourtListener: details = { "name": "CourtListener", - "short_description": "hello", - "long_description": "CourtListener searches millions of opinions across hundreds of jurisdictions", + "short_description": "CourtListener contains millions of legal opinions.", + "long_description": "CourtListener searches millions of opinions across hundreds of jurisdictions.", "link": settings.COURTLISTENER_BASE_URL, "search_regexes": [], "footnote_regexes": [], @@ -584,6 +584,7 @@ def pull(legal_doc_source, id): ) resp.raise_for_status() cluster = resp.json() + cluster["html_info"] = {"source": "court listener"} if cluster["filepath_json_harvard"]: harvard_xml_data = "" @@ -608,17 +609,17 @@ def pull(legal_doc_source, id): ] case = LegalDocument( source=legal_doc_source, - short_name=cluster["case_name"], - name=cluster["case_name"], + short_name=cluster.get("case_name"), + name=cluster.get("case_name"), doc_class="Case", citations=citations, - jurisdiction="", - effective_date=cluster["date_filed"], - publication_date=cluster["date_filed"], + jurisdiction=cluster.get("court_id"), + effective_date=parser.parse(cluster.get("date_filed")), + publication_date=parser.parse(cluster.get("date_modified")), updated_date=datetime.now(), source_ref=str(id), content=case_html, - metadata=None, + metadata=cluster, ) return case