diff --git a/ajapaik/ajapaik/views.py b/ajapaik/ajapaik/views.py index fc1a45de0..809781526 100644 --- a/ajapaik/ajapaik/views.py +++ b/ajapaik/ajapaik/views.py @@ -503,7 +503,7 @@ def _get_filtered_data_for_frontpage(request, album_id=None, page_override=None) # In some cases it is faster to get number of photos before we annotate new columns to it albumsize_before_sorting = 0 if not album: - albumsize_before_sorting = Photo.objects.filter(pk__in=photos).cached_count(q) + albumsize_before_sorting = Photo.objects.filter(pk__in=photos).cached_count(str(filter_form.cleaned_data)) # SORTING BELOW THIS LINE