fix - soft delete in quota binary tree & CO level of show organizations
This commit is contained in:
13
apps/product/services/distribution_child.py
Normal file
13
apps/product/services/distribution_child.py
Normal file
@@ -0,0 +1,13 @@
|
||||
import typing
|
||||
|
||||
|
||||
def get_all_distribution_child(distribution: object = None) -> typing.Any:
|
||||
"""
|
||||
get all child of an distribution
|
||||
"""
|
||||
descendants = []
|
||||
children = distribution.children.all() # noqa
|
||||
for child in children:
|
||||
descendants.append(child)
|
||||
descendants.extend(get_all_distribution_child(child))
|
||||
return descendants
|
||||
Reference in New Issue
Block a user