Skip to content

Commit

Permalink
Merge branch 'main' into 2988-django-admin-tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
elisa-a-v authored Dec 23, 2024
2 parents a1e9d4a + 756226e commit d64ecf7
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 79 deletions.
55 changes: 0 additions & 55 deletions cl/search/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
9 changes: 9 additions & 0 deletions cl/settings/third_party/rest_framework.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,20 @@
"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",
"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",
"court_api_5": "1/hour",
"JamesBond": "1/hour",
"JackSparrow": "1/hour",
"PeterPan": "1/hour",
Expand Down
46 changes: 22 additions & 24 deletions cl/simple_pages/templates/help/prayer_help.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}

Expand Down Expand Up @@ -34,8 +34,9 @@ <h3>Table of Contents</h3>
<li>
<a href="#pray-and-pay">Pray and Pay Project</a>
<ul>
<li><a href="#limitations">Limitations</a></li>
<li><a href="#fulfilling-prayer">Fulfilling a Prayer</a></li>
<li><a href="#creating-prayer">Creating a Prayer</a></li>
<li><a href="#limitations">Limitations</a></li>
<li><a href="#deleting-prayer">Deleting a Prayer</a></li>
</ul>
</li>
Expand All @@ -48,40 +49,40 @@ <h3>Table of Contents</h3>
<div class="col-xs-12 col-md-8 col-lg-6">
<h1 id="about">Help with Pray and Pay&nbsp;Project</h1>
<p class="lead">Since 2009, CourtListener has helped people keep up with new cases and legal topics.</p>
<p>As part of the pray and pay project, we now allow users to crowdfund federal court documents.</p>
<p>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.</p>

<h2 id="pray-and-pay">Pray and Pay Project</h2>
<p>PACER is the largest paywall on the internet, with thousands of new documents filed daily. These documents are expensive.
<p>PACER is the largest paywall on the internet with around a half-million new documents filed weekly.
</p>
<p>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.
<p>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.
</p>
<p>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.
<p class="alert alert-warning"><i class="fa fa-warning"></i> <strong>Listen Up:</strong> 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.
</p>
<p>Since the project's creation, users have fulfilled <span class="bold">{{ granted_stats.prayer_count|intcomma }}</span> prayers for <span class="bold">{{ granted_stats.distinct_count|intcomma }}</span> distinct documents, for a total cost of <span class="bold">${{ granted_stats.total_cost }}</span>.
<p>Since the project's creation, users have fulfilled <span class="bold">{{ granted_stats.prayer_count|intcomma }}</span> prayers for <span class="bold">{{ granted_stats.distinct_count|intcomma }}</span> documents, for a total contribution of <span class="bold">${{ granted_stats.total_cost }}</span>!
</p>

<h3 id="limitations">Limitations</h3>
<p>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 <span class="bold">{{ daily_quota }}</span> requests. This is a rolling limit over 24 hour periods.
</p>
<p>Requests are ranked on a <a href="{% url "top_prayers" %}">leaderboard</a> 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.

<h3 id="fulfilling-prayer">Fulfilling a Prayer</h3>
<p>The most-wanted documents are shown on a <a href="{% url "top_prayers" %}">leaderboard</a> 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.
</p>
<p>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!</p>
<p>
<a href="https://free.law/recap/"
class="btn btn-primary">Install RECAP</a>
<a href="https://donate.free.law/forms/membership"
class="btn btn-danger"><i class="fa fa-heart-o"></i> Join Free.law</a>
<a href="{% url "top_prayers" %}"
class="btn btn-primary"> See the Leaderboard</a>
</p>

<h3 id="creating-prayer">Creating a Prayer</h3>
<p>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.
<p>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.
</p>
<p>
<img src="{% static "png/pray-button.png" %}"
alt="screenshot of the prayer button"
class="img-responsive img-rounded shadow center-block"
width="45">
</p>
<p>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.
<p>When your prayer is granted, we will send you an email so you know.
</p>
<p>Here's an example of what an email might look like:</p>
<p class="v-offset-above-2">
Expand All @@ -97,15 +98,12 @@ <h3 id="creating-prayer">Creating a Prayer</h3>
(Click for full size version.)
</p>

<h3 id="deleting-prayer">Deleting a Prayer</h3>
<p>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 %}<a href="{% url 'user_prayers' user.username %}">list of prayers in your profile</a>{% 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.
<h3 id="limitations">Limitations</h3>
<p>Each user can place <span class="bold">{{ daily_quota }}</span> prayers per day. This prevents people from praying for every item on the site.
</p>
<p>
{% comment %} <img src="{% static "png/docket-alert-disable-button.png" %}"
alt="screenshot of the delete button"
class="img-responsive img-rounded shadow center-block"
height="31"
width="119"> {% endcomment %}

<h3 id="deleting-prayer">Deleting a Prayer</h3>
<p>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 %}<a href="{% url 'user_prayers' user.username %}">list of prayers in your profile</a>{% else %}list of prayers in your profile{% endif %} and delete from there. It is not possible to delete a prayer once it is fulfilled.
</p>

<h2>Coming Soon</h2>
Expand Down

0 comments on commit d64ecf7

Please sign in to comment.