From c3fee39b87dd3d2f9ba08bdbfc8552e3cb96297c Mon Sep 17 00:00:00 2001 From: mlissner Date: Thu, 19 Dec 2024 16:35:40 -0800 Subject: [PATCH 1/5] fix(solr): Remove unused method --- cl/search/models.py | 55 --------------------------------------------- 1 file changed, 55 deletions(-) diff --git a/cl/search/models.py b/cl/search/models.py index 11e01e8a1c..51084008e3 100644 --- a/cl/search/models.py +++ b/cl/search/models.py @@ -1558,61 +1558,6 @@ def clean(self): logger.error(msg) raise ValidationError({"attachment_number": msg}) - def get_docket_metadata(self): - """The metadata for the item that comes from the Docket.""" - docket = self.docket_entry.docket - # IDs - out = { - "docket_id": docket.pk, - "court_id": docket.court.pk, - "assigned_to_id": getattr(docket.assigned_to, "pk", None), - "referred_to_id": getattr(docket.referred_to, "pk", None), - } - - # Docket - out.update( - { - "docketNumber": docket.docket_number, - "caseName": best_case_name(docket), - "suitNature": docket.nature_of_suit, - "cause": docket.cause, - "juryDemand": docket.jury_demand, - "jurisdictionType": docket.jurisdiction_type, - } - ) - if docket.date_argued is not None: - out["dateArgued"] = midnight_pt(docket.date_argued) - if docket.date_filed is not None: - out["dateFiled"] = midnight_pt(docket.date_filed) - if docket.date_terminated is not None: - out["dateTerminated"] = midnight_pt(docket.date_terminated) - try: - out["docket_absolute_url"] = docket.get_absolute_url() - except NoReverseMatch: - raise InvalidDocumentError( - f"Unable to save to index due to missing absolute_url: {self.pk}" - ) - - # Judges - if docket.assigned_to is not None: - out["assignedTo"] = docket.assigned_to.name_full - elif docket.assigned_to_str: - out["assignedTo"] = docket.assigned_to_str - if docket.referred_to is not None: - out["referredTo"] = docket.referred_to.name_full - elif docket.referred_to_str: - out["referredTo"] = docket.referred_to_str - - # Court - out.update( - { - "court": docket.court.full_name, - "court_exact": docket.court_id, # For faceting - "court_citation_string": docket.court.citation_string, - } - ) - return out - def get_csv_columns(self, get_column_name=False): columns = [ "id", From ff1e662242eb90812e0e38573025da78e9d7a177 Mon Sep 17 00:00:00 2001 From: mlissner Date: Thu, 19 Dec 2024 16:35:53 -0800 Subject: [PATCH 2/5] feat(docs): Tweaks to P&P docs --- .../templates/help/prayer_help.html | 46 +++++++++---------- 1 file changed, 22 insertions(+), 24 deletions(-) diff --git a/cl/simple_pages/templates/help/prayer_help.html b/cl/simple_pages/templates/help/prayer_help.html index 2a9758de46..a3e22aa266 100644 --- a/cl/simple_pages/templates/help/prayer_help.html +++ b/cl/simple_pages/templates/help/prayer_help.html @@ -4,8 +4,8 @@ {% block title %}Help with Pray and Pay Project – CourtListener.com{% endblock %} {% block og_title %}Help with Pray and Pay Project – CourtListener.com{% endblock %} -{% block description %}Get help requesting documents on CourtListener.{% endblock %} -{% block og_description %}Get help requesting documents on CourtListener.{% endblock %} +{% block description %}The Pray and Pay project helps you flag PACER documents you want so others can buy them for you. Learn more.{% endblock %} +{% block og_description %}The Pray and Pay project helps you flag PACER documents you want so others can buy them for you. Learn more.{% endblock %} {% block sidebar %}{% endblock %} @@ -34,8 +34,9 @@

Table of Contents

  • Pray and Pay Project
  • @@ -48,32 +49,32 @@

    Table of Contents

    Help with Pray and Pay Project

    Since 2009, CourtListener has helped people keep up with new cases and legal topics.

    -

    As part of the pray and pay project, we now allow users to crowdfund federal court documents.

    +

    The Pray and Pay Project is a system so you can "Pray" for PACER documents you want, and others can grant those prayers by "Paying" for them on your behalf.

    Pray and Pay Project

    -

    PACER is the largest paywall on the internet, with thousands of new documents filed daily. These documents are expensive. +

    PACER is the largest paywall on the internet with around a half-million new documents filed weekly.

    -

    To advance our mission of open access to the courts, we allow you to both request documents and to pay it forward by purchasing those requested by others in the community. +

    To advance our mission of open access to the courts, this system allows you to request documents you want on PACER (by "praying" for them), and to fulfill the prayers of others by buying the most-wanted documents in the community.

    -

    PACER waives the first $30.00 of purchases by anyone in each quarter. Leveraging this will allow users to have more access to court documents. +

    Listen Up: PACER waives the first $30.00 of purchases you make each quarter. By sending reminder emails near the end of each quarter, we encourage users to use this money to contribute the documents other users need.

    -

    Since the project's creation, users have fulfilled {{ granted_stats.prayer_count|intcomma }} prayers for {{ granted_stats.distinct_count|intcomma }} distinct documents, for a total cost of ${{ granted_stats.total_cost }}. +

    Since the project's creation, users have fulfilled {{ granted_stats.prayer_count|intcomma }} prayers for {{ granted_stats.distinct_count|intcomma }} documents, for a total contribution of ${{ granted_stats.total_cost }}!

    -

    Limitations

    -

    In order to faciliate the broadest possible access to court documents and prevent a single user from controlling the requests, we maintain a daily limit of {{ daily_quota }} requests. This is a rolling limit over 24 hour periods. -

    -

    Requests are ranked on a leaderboard based on a function that incorporates both how many users have requested a particular document and how old those requests are. As requests are fulfilled, they are removed from the leaderboard. + +

    Fulfilling a Prayer

    +

    The most-wanted documents are shown on a leaderboard ranked by how many users have requested a particular document and how old the requests are. As requests are fulfilled, they are removed from the leaderboard.

    +

    Fulfilling somebody's prayer only works if you install the RECAP extension. Once it's installed, all your PACER purchases will be sent to CourtListener automatically — Prayers will be granted!

    Install RECAP - Join Free.law + See the Leaderboard

    Creating a Prayer

    -

    To create a Prayer, find a document you are interested in on a particular docket, and press the 🙏 button on the right. The number on the button is how many others have requested the document. If you have reached your daily limit, you will be informed by a message. +

    To create a Prayer, find a document you are interested in, and press the "Prayer Hands" emoji button on the right (🙏). The number on the button is how many others have requested the document. If you have reached your daily limit, a message will inform you.

    Creating a Prayer class="img-responsive img-rounded shadow center-block" width="45">

    -

    That's all there is to it. You'll receive an email as soon as someone purchases the document and it is uploaded to RECAP. +

    When your prayer is granted, we will send you an email so you know.

    Here's an example of what an email might look like:

    @@ -97,15 +98,12 @@

    Creating a Prayer

    (Click for full size version.)

    -

    Deleting a Prayer

    -

    To delete a Prayer, navigate to a docket you have previously requested a document from, and press the 🙏 button on the right again. Alternatively, you can navigate to the {% if user.is_authenticated %}list of prayers in your profile{% else %}list of prayers in your profile{% endif %} and mass delete from there. It is not possible to delete a prayer once it is fulfilled. +

    Limitations

    +

    Each user can place {{ daily_quota }} prayers per day. This prevents people from praying for every item on the site.

    -

    - {% comment %} screenshot of the delete button {% endcomment %} + +

    Deleting a Prayer

    +

    To delete a Prayer, navigate to a docket you have previously requested a document from, and press the 🙏 button on the right again. Alternatively, you can navigate to the {% if user.is_authenticated %}list of prayers in your profile{% else %}list of prayers in your profile{% endif %} and delete from there. It is not possible to delete a prayer once it is fulfilled.

    Coming Soon

    From 7c8fc4a45e81261c3b6adc1fd51e2449d1357f0f Mon Sep 17 00:00:00 2001 From: mlissner Date: Fri, 20 Dec 2024 14:30:02 -0800 Subject: [PATCH 3/5] feat(api): Block users --- cl/settings/third_party/rest_framework.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cl/settings/third_party/rest_framework.py b/cl/settings/third_party/rest_framework.py index 1463321f79..5462be7881 100644 --- a/cl/settings/third_party/rest_framework.py +++ b/cl/settings/third_party/rest_framework.py @@ -34,6 +34,12 @@ "api_account_3": "1/hour", "api_account_4": "1/hour", "api_account_5": "1/hour", + "court_test_account_3": "1/hour", + "court_test_account_2": "1/hour", + "court_api_1": "1/hour", + "court_api_2": "1/hour", + "court_api_3": "1/hour", + "court_api_4": "1/hour", "JamesBond": "1/hour", "JackSparrow": "1/hour", "PeterPan": "1/hour", From 2020857a0ce36713210b8b6760229c44819b73d8 Mon Sep 17 00:00:00 2001 From: mlissner Date: Sun, 22 Dec 2024 11:00:17 -0800 Subject: [PATCH 4/5] feat(api): Block users --- cl/settings/third_party/rest_framework.py | 1 + 1 file changed, 1 insertion(+) diff --git a/cl/settings/third_party/rest_framework.py b/cl/settings/third_party/rest_framework.py index 5462be7881..8f382a9d00 100644 --- a/cl/settings/third_party/rest_framework.py +++ b/cl/settings/third_party/rest_framework.py @@ -40,6 +40,7 @@ "court_api_2": "1/hour", "court_api_3": "1/hour", "court_api_4": "1/hour", + "court_api_5": "1/hour", "JamesBond": "1/hour", "JackSparrow": "1/hour", "PeterPan": "1/hour", From d39e0fb09d5a88730aae64a9f3b2e0425120f5f8 Mon Sep 17 00:00:00 2001 From: mlissner Date: Mon, 23 Dec 2024 10:56:40 -0800 Subject: [PATCH 5/5] feat(api): Block users --- cl/settings/third_party/rest_framework.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cl/settings/third_party/rest_framework.py b/cl/settings/third_party/rest_framework.py index 8f382a9d00..b8dc60f4d8 100644 --- a/cl/settings/third_party/rest_framework.py +++ b/cl/settings/third_party/rest_framework.py @@ -29,6 +29,8 @@ "OVERRIDE_THROTTLE_RATES": { # Throttling down. # Multiple accounts + "api_1": "1/hour", + "api_2": "1/hour", "api_account_1": "1/hour", "api_account_2": "1/hour", "api_account_3": "1/hour",