diff --git a/apps/functions/custom_views.py b/apps/functions/custom_views.py index b4f26f5e..996cbdc6 100644 --- a/apps/functions/custom_views.py +++ b/apps/functions/custom_views.py @@ -569,6 +569,7 @@ class ReverseOrderMixin(ContextMixin): if isinstance(children, tuple): if children[0].startswith('data_begin'): continue + childrens.append(children) elif isinstance(children, SearchNode): node_childrens = list(filter(lambda x: not x[0].startswith('data_begin'), children.children)) if node_childrens: @@ -577,7 +578,8 @@ class ReverseOrderMixin(ContextMixin): qs.query.query_filter.children = childrens self.extra_ctx['events_reversed'] = True qs.query.clear_order_by() - return qs.filter(data_begin__lte=datetime.now()).order_by('-data_begin') + qs = qs.filter(data_begin__lte=datetime.now()).order_by('-data_begin') + return qs def get_queryset(self): qs = super(ReverseOrderMixin, self).get_queryset()