Skip to content

Commit

Permalink
Change bill not found to 404, closes #116
Browse files Browse the repository at this point in the history
  • Loading branch information
erinspace committed Jan 14, 2016
1 parent c92becf commit f8e3640
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions bills/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import string

from django.db.models import Q
from django.shortcuts import render
from django.shortcuts import render, get_object_or_404

from django.contrib.auth.models import User

Expand Down Expand Up @@ -363,8 +363,7 @@ def filter_organize_bills(topics_followed, locations_followed):


def bill_detail(request, bill_session, bill_identifier):
bill = Bill.objects.get(legislative_session__identifier=bill_session, identifier=bill_identifier)

bill = get_object_or_404(Bill, legislative_session__identifier=bill_session, identifier=bill_identifier)
sponsors = bill.sponsorships.all().select_related('person', 'organization')

for sponsor in sponsors:
Expand Down

0 comments on commit f8e3640

Please sign in to comment.