Skip to content
Snippets Groups Projects

Resolve "Review tasks"

Merged Jonathan Weth requested to merge 8-review-tasks into master
1 unresolved thread
1 file
+ 13
7
Compare changes
  • Side-by-side
  • Inline
@@ -287,13 +287,19 @@ class MatrixSpace(MatrixRoom):
def sync_children(self):
"""Sync membership of child spaces and rooms."""
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_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 = list(child_spaces) + list(child_rooms)
Loading