mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-19 01:15:11 -04:00
ensure results have icons
This commit is contained in:
parent
3048c0f6dc
commit
6f7cc2b3ef
1 changed files with 6 additions and 5 deletions
|
@ -114,8 +114,8 @@ class PublicArchiveView(ListView):
|
||||||
model = Snapshot
|
model = Snapshot
|
||||||
paginate_by = 100
|
paginate_by = 100
|
||||||
|
|
||||||
def get_queryset(self, *args, **kwargs):
|
def get_queryset(self, **kwargs):
|
||||||
qs = super(PublicArchiveView, self).get_queryset(*args, **kwargs)
|
qs = super().get_queryset(**kwargs)
|
||||||
for snapshot in qs:
|
for snapshot in qs:
|
||||||
snapshot.icons = get_icons(snapshot)
|
snapshot.icons = get_icons(snapshot)
|
||||||
return qs
|
return qs
|
||||||
|
@ -128,8 +128,9 @@ class PublicArchiveView(ListView):
|
||||||
return redirect(f'/admin/login/?next={self.request.path}')
|
return redirect(f'/admin/login/?next={self.request.path}')
|
||||||
|
|
||||||
class SearchResultsView(PublicArchiveView):
|
class SearchResultsView(PublicArchiveView):
|
||||||
def get_queryset(self, *args, **kwargs):
|
def get_queryset(self):
|
||||||
qs = super(PublicArchiveView, self).get_queryset(*args, **kwargs)
|
|
||||||
query = self.request.GET.get('q')
|
query = self.request.GET.get('q')
|
||||||
results = qs.filter(title__icontains=query)
|
results = Snapshot.objects.filter(title__icontains=query)
|
||||||
|
for snapshot in results:
|
||||||
|
snapshot.icons = get_icons(snapshot)
|
||||||
return results
|
return results
|
Loading…
Add table
Add a link
Reference in a new issue