Skip to content
Snippets Groups Projects
Verified Commit c03900df authored by Jonathan Weth's avatar Jonathan Weth :keyboard:
Browse files

Optimise query in sync_children

parent 81bdaa12
No related branches found
No related tags found
1 merge request!2Resolve "Review tasks"
Pipeline #56072 canceled
......@@ -289,13 +289,13 @@ class MatrixSpace(MatrixRoom):
current_children = self.get_children()
child_spaces = MatrixSpace.get_queryset().filter(
group__in=self.group.child_groups.filter(child_groups__isnull=False)
)
).values_list("room_id", flat=True)
child_rooms = MatrixRoom.get_queryset().filter(
Q(group__in=self.group.child_groups.filter(child_groups__isnull=True))
| Q(group=self.group)
)
).values_list("room_id", flat=True)
child_ids = [m.room_id for m in list(child_spaces) + list(child_rooms)]
child_ids = list(child_spaces) + list(child_rooms)
missing_ids = set(child_ids).difference(set(current_children))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment