mirror of
https://github.com/Hopiu/wagtail.git
synced 2026-04-29 19:14:49 +00:00
Remove assert from DescendantOfFilter.filter_queryset method
This commit is contained in:
parent
07036abb1c
commit
36c2f48d10
1 changed files with 3 additions and 2 deletions
|
|
@ -191,10 +191,11 @@ class DescendantOfFilter(BaseFilterBackend):
|
|||
raise BadRequestError("filtering by descendant_of with child_of is not supported")
|
||||
try:
|
||||
parent_page_id = int(request.GET['descendant_of'])
|
||||
assert parent_page_id >= 0
|
||||
if parent_page_id < 0:
|
||||
raise ValueError()
|
||||
|
||||
parent_page = self.get_page_by_id(request, parent_page_id)
|
||||
except (ValueError, AssertionError):
|
||||
except ValueError:
|
||||
if request.GET['descendant_of'] == 'root':
|
||||
parent_page = self.get_root_page(request)
|
||||
else:
|
||||
|
|
|
|||
Loading…
Reference in a new issue