Skip to content

Commit

Permalink
correct related name on order outcomes
Browse files Browse the repository at this point in the history
otherwise we get this error when indexing after updating order outcome
names:

File "/app/peachjam_search/documents.py", line 177, in get_instances_from_related
    return related_instance.judgments.all()
AttributeError: 'OrderOutcome' object has no attribute 'judgments'
  • Loading branch information
longhotsummer committed Mar 6, 2024
1 parent ae6c7e1 commit c21fe58
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
20 changes: 20 additions & 0 deletions peachjam/migrations/0123_alter_judgment_order_outcomes.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Generated by Django 3.2.20 on 2024-03-06 10:04

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("peachjam", "0122_lower_court_judges"),
]

operations = [
migrations.AlterField(
model_name="judgment",
name="order_outcomes",
field=models.ManyToManyField(
blank=True, related_name="judgments", to="peachjam.OrderOutcome"
),
),
]
1 change: 1 addition & 0 deletions peachjam/models/judgment.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ class Judgment(CoreDocument):
order_outcomes = models.ManyToManyField(
OrderOutcome,
blank=True,
related_name="judgments",
)
case_summary = models.TextField(_("case summary"), null=True, blank=True)
flynote = models.TextField(_("flynote"), null=True, blank=True)
Expand Down

0 comments on commit c21fe58

Please sign in to comment.