mirror of
https://github.com/Hopiu/wagtail.git
synced 2026-04-07 08:31:05 +00:00
fix flake8 error
This commit is contained in:
parent
c6548fea12
commit
f249aba6ef
1 changed files with 4 additions and 1 deletions
|
|
@ -80,9 +80,12 @@ class Delete(DeleteView):
|
|||
hook(self.instance)
|
||||
for hook in hooks.get_hooks('describe_collection_contents')
|
||||
]
|
||||
|
||||
# filter out any hook responses that report that the collection is empty
|
||||
# (by returning None, or a dict with 'count': 0)
|
||||
is_nonempty = lambda item_type: item_type and item_type['count'] > 0
|
||||
def is_nonempty(item_type):
|
||||
return item_type and item_type['count'] > 0
|
||||
|
||||
return list(filter(is_nonempty, collection_contents))
|
||||
|
||||
def get_context(self):
|
||||
|
|
|
|||
Loading…
Reference in a new issue