mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-17 08:34:26 -04:00
Hotfix public page search
No ordering causes warning and fallback to default unfiltered QuerySet
This commit is contained in:
parent
ed54df499e
commit
69897f6121
1 changed files with 2 additions and 1 deletions
|
@ -94,6 +94,7 @@ 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_context_data(self, **kwargs):
|
def get_context_data(self, **kwargs):
|
||||||
return {
|
return {
|
||||||
|
@ -106,7 +107,7 @@ class PublicArchiveView(ListView):
|
||||||
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 = snapshot_icons(snapshot)
|
snapshot.icons = snapshot_icons(snapshot)
|
||||||
return qs
|
return qs
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue