Fixed #351 -- views.generic.list_detail.object_list now respects allow_empty when paginating. Thanks, kmh
git-svn-id: http://code.djangoproject.com/svn/django/trunk@618 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
5c22b8b4b7
commit
66d4db7b09
|
@ -40,6 +40,9 @@ def object_list(request, app_label, module_name, paginate_by=None, allow_empty=F
|
|||
try:
|
||||
object_list = paginator.get_page(page)
|
||||
except InvalidPage:
|
||||
if page == 0 and allow_empty:
|
||||
object_list = []
|
||||
else:
|
||||
raise Http404
|
||||
page = int(page)
|
||||
c = Context(request, {
|
||||
|
|
Loading…
Reference in New Issue