Skip to content

Commit

Permalink
Merge pull request #92 from hiroTochigi/fix-issue-91
Browse files Browse the repository at this point in the history
Fix issue 91
  • Loading branch information
ezrinjaz authored Apr 7, 2021
2 parents a612535 + 2353f7a commit 28b35f7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
12 changes: 11 additions & 1 deletion api/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,23 @@

from django.test import RequestFactory, TestCase

from .views import reminders, eligible_jurisdiction
from .views import (
reminders,
eligible_jurisdiction,
find_arraignment_or_return_False,
)
from alerts.models import Alert


class testReminders(TestCase):
def setUp(self):
self.factory = RequestFactory()
class Event:
case_index
Docket
Event
Party
Reporter

def _post(self, url, params):
return self.factory.post(url, params)
Expand Down
4 changes: 3 additions & 1 deletion api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@ def eligible_jurisdiction(request):

def find_arraignment_or_return_False(events):
for event in events:
if "arraignment" in event.Docket.lower():
if not "Event" in dir(event):
continue
if "arraignment" in event.Event.lower():
return event
return False

Expand Down

0 comments on commit 28b35f7

Please sign in to comment.