summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorBaptiste Mispelon <bmispelon@gmail.com>2014-07-29 11:06:32 +0200
committerBaptiste Mispelon <bmispelon@gmail.com>2014-07-29 11:06:32 +0200
commite5619330e2d3bf901155e98ef3fa7d224b6a260a (patch)
tree8e3ddd059786b8aaa5df4e0efacca2b7e2b7eb84 /docs
parent62c74abbb06a081708c2cb5cc459f39beb26acaa (diff)
Fixed #23123 -- Don't use a bare except in ModelAdmin documentation
Thanks to wkschwartz for the report and to Tim for the patch.
Diffstat (limited to 'docs')
-rw-r--r--docs/ref/contrib/admin/index.txt5
1 files changed, 3 insertions, 2 deletions
diff --git a/docs/ref/contrib/admin/index.txt b/docs/ref/contrib/admin/index.txt
index 3ef058aa0f..1b137f6448 100644
--- a/docs/ref/contrib/admin/index.txt
+++ b/docs/ref/contrib/admin/index.txt
@@ -1300,9 +1300,10 @@ templates used by the :class:`ModelAdmin` views:
queryset, use_distinct = super(PersonAdmin, self).get_search_results(request, queryset, search_term)
try:
search_term_as_int = int(search_term)
- queryset |= self.model.objects.filter(age=search_term_as_int)
- except:
+ except ValueError:
pass
+ else:
+ queryset |= self.model.objects.filter(age=search_term_as_int)
return queryset, use_distinct
.. method:: ModelAdmin.save_related(request, form, formsets, change)