Browse Source

Merge pull request #559 from jdcaballerov/hotfix-public-search

Hotfix public page search
Nick Sweeting 5 years ago
parent
commit
193dde03f0
1 changed files with 2 additions and 1 deletions
  1. 2 1
      archivebox/core/views.py

+ 2 - 1
archivebox/core/views.py

@@ -92,12 +92,13 @@ class PublicArchiveView(ListView):
     template = 'snapshot_list.html'
     template = 'snapshot_list.html'
     model = Snapshot
     model = Snapshot
     paginate_by = 100
     paginate_by = 100
+    ordering = ['title']
 
 
     def get_queryset(self, **kwargs): 
     def get_queryset(self, **kwargs): 
         qs = super().get_queryset(**kwargs) 
         qs = super().get_queryset(**kwargs) 
         query = self.request.GET.get('q')
         query = self.request.GET.get('q')
         if query:
         if query:
-            qs = Snapshot.objects.filter(title__icontains=query)
+            qs = qs.filter(title__icontains=query)
         for snapshot in qs:
         for snapshot in qs:
             snapshot.icons = get_icons(snapshot) 
             snapshot.icons = get_icons(snapshot) 
         return qs
         return qs