diff --git a/django/contrib/admin/views/main.py b/django/contrib/admin/views/main.py index 8c09c10ab3..55e9d6f64a 100644 --- a/django/contrib/admin/views/main.py +++ b/django/contrib/admin/views/main.py @@ -116,7 +116,7 @@ class ChangeList(object): try: result_list = paginator.page(self.page_num+1).object_list except InvalidPage: - result_list = () + raise IncorrectLookupParameters self.result_count = result_count self.full_result_count = full_result_count diff --git a/tests/regressiontests/admin_changelist/tests.py b/tests/regressiontests/admin_changelist/tests.py index cb16f4b892..96b36f8355 100644 --- a/tests/regressiontests/admin_changelist/tests.py +++ b/tests/regressiontests/admin_changelist/tests.py @@ -1,4 +1,5 @@ from django.contrib import admin +from django.contrib.admin.options import IncorrectLookupParameters from django.contrib.admin.views.main import ChangeList from django.template import Context, Template from django.test import TransactionTestCase @@ -71,6 +72,28 @@ class ChangeListTests(TransactionTestCase): self.assertFalse('