瀏覽代碼

Fixes #1193 Bug: Search sometimes shows the same snapshot twice (#1330)

fixes #1193 Bug: Search sometimes shows the same snapshot twice
Nick Sweeting 1 年之前
父節點
當前提交
22eff07a11
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      archivebox/core/views.py

+ 1 - 1
archivebox/core/views.py

@@ -231,7 +231,7 @@ class PublicIndexView(ListView):
                 qs = qs | query_search_index(query)
                 qs = qs | query_search_index(query)
             except Exception as err:
             except Exception as err:
                 print(f'[!] Error while using search backend: {err.__class__.__name__} {err}')
                 print(f'[!] Error while using search backend: {err.__class__.__name__} {err}')
-        return qs
+        return qs.distinct()
 
 
     def get(self, *args, **kwargs):
     def get(self, *args, **kwargs):
         if PUBLIC_INDEX or self.request.user.is_authenticated:
         if PUBLIC_INDEX or self.request.user.is_authenticated: