mirror of
https://github.com/ArchiveBox/ArchiveBox
synced 2024-11-26 14:10:20 +00:00
Hotfix public page search
No ordering causes warning and fallback to default unfiltered QuerySet
This commit is contained in:
parent
4372cb6eec
commit
4d972571d0
1 changed files with 2 additions and 1 deletions
|
@ -92,12 +92,13 @@ class PublicArchiveView(ListView):
|
|||
template = 'snapshot_list.html'
|
||||
model = Snapshot
|
||||
paginate_by = 100
|
||||
ordering = ['title']
|
||||
|
||||
def get_queryset(self, **kwargs):
|
||||
qs = super().get_queryset(**kwargs)
|
||||
query = self.request.GET.get('q')
|
||||
if query:
|
||||
qs = Snapshot.objects.filter(title__icontains=query)
|
||||
qs = qs.filter(title__icontains=query)
|
||||
for snapshot in qs:
|
||||
snapshot.icons = get_icons(snapshot)
|
||||
return qs
|
||||
|
|
Loading…
Reference in a new issue