summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorJannis Leidel <jannis@leidel.info>2011-05-03 13:52:39 +0000
committerJannis Leidel <jannis@leidel.info>2011-05-03 13:52:39 +0000
commit05b4f2ebc2f547d2413f738551f9933aae0d34dc (patch)
tree7b004559cdfbdf094f7cd7a1f3f80df3aeefe338 /django
parent950e05c3ff5daa360c3bddb84831d40b167062f1 (diff)
Corrected the behavior of the SimpleFilter.lookups method to also be able to return None. Also modified example in documentation to be a bite more realistic. Refs #5833. Thanks for the hint, Martin Mahner.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16150 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django')
-rw-r--r--django/contrib/admin/filters.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/django/contrib/admin/filters.py b/django/contrib/admin/filters.py
index 0e3e2e504c..36dcea1ea7 100644
--- a/django/contrib/admin/filters.py
+++ b/django/contrib/admin/filters.py
@@ -63,7 +63,10 @@ class SimpleListFilter(ListFilter):
raise ImproperlyConfigured(
"The list filter '%s' does not specify "
"a 'parameter_name'." % self.__class__.__name__)
- self.lookup_choices = self.lookups(request)
+ lookup_choices = self.lookups(request)
+ if lookup_choices is None:
+ lookup_choices = ()
+ self.lookup_choices = lookup_choices
def has_output(self):
return len(self.lookup_choices) > 0