Commit ea372832 authored by Sofia Papagiannaki's avatar Sofia Papagiannaki
Browse files

Fix pagination in search group view

parent 84814a1a
......@@ -39,7 +39,7 @@
</ul>
{% endif %}
{% with page_obj.object_list|enabled:is_search as object_list %}
{% with page_obj.object_list as object_list %}
{% if object_list %}
<div class="full-dotted">
<table class="alt-style complex">
......
......@@ -75,13 +75,6 @@ def dkeys(d):
return d.keys()
@register.filter
def enabled(object_list, is_search):
if not is_search:
return object_list
return [g for g in object_list if g.is_enabled]
@register.filter
def month_name(month_number):
return calendar.month_name[month_number]
......
......@@ -792,7 +792,7 @@ def group_search(request, extra_context=None, **kwargs):
q = form.cleaned_data['q'].strip()
if q:
queryset = AstakosGroup.objects.select_related(
).filter(name__contains=q)
).filter(name__contains=q).filter(approval_date__isnull=False)
else:
queryset = AstakosGroup.objects.none()
return object_list(
......@@ -810,7 +810,8 @@ def group_search(request, extra_context=None, **kwargs):
def group_all(request, extra_context=None, **kwargs):
return object_list(
request,
AstakosGroup.objects.select_related().all(),
AstakosGroup.objects.select_related().filter(
approval_date__isnull=False),
paginate_by=PAGINATE_BY,
page=request.GET.get('page') or 1,
template_name='im/astakosgroup_list.html',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment