mirror of
https://github.com/django/django.git
synced 2025-06-04 11:09:13 +00:00
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:
|
try:
|
||||||
object_list = paginator.get_page(page)
|
object_list = paginator.get_page(page)
|
||||||
except InvalidPage:
|
except InvalidPage:
|
||||||
|
if page == 0 and allow_empty:
|
||||||
|
object_list = []
|
||||||
|
else:
|
||||||
raise Http404
|
raise Http404
|
||||||
page = int(page)
|
page = int(page)
|
||||||
c = Context(request, {
|
c = Context(request, {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user