- album = Album.objects.get(slug__exact=slug)
- photos = Photo.objects.filter(album=album).order_by('order', 'image')
- return django.views.generic.list_detail.object_list(request, photos, paginate_by=20, template_name='photo/photo_index.html')
+ try:
+ album = Album.objects.get(slug__exact=slug)
+ photos = Photo.objects.filter(album=album).order_by('order', 'image')
+ except:
+ raise Http404
+ return django.views.generic.list_detail.object_list(request, photos, paginate_by=20, template_name='photo/photo_index.html', allow_empty=False)