From bf76ab7f7cd8f7ff72c58a67309a3760987ee40d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jan=20Bedna=C5=99=C3=ADk?= <jan.bednarik@gmail.com>
Date: Fri, 2 Nov 2018 15:20:23 +0100
Subject: [PATCH] Order reports by published date as default

---
 openlobby/core/search.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/openlobby/core/search.py b/openlobby/core/search.py
index 56277ed..c72d581 100644
--- a/openlobby/core/search.py
+++ b/openlobby/core/search.py
@@ -24,7 +24,7 @@ def query_reports(query, paginator, *, highlight=False):
         s = s.query("multi_match", query=query, fields=fields)
     if highlight:
         s = s.highlight(*fields, **HIGHLIGHT_PARAMS)
-    s = s.sort("-date")
+    s = s.sort("-published")
     s = s[paginator.slice_from : paginator.slice_to]
     return s.execute()
 
@@ -34,6 +34,6 @@ def reports_by_author(author_id, paginator):
     s = s.exclude("term", is_draft=True)
     s = s.exclude("exists", field="superseded_by_id")
     s = s.filter("term", author_id=author_id)
-    s = s.sort("-date")
+    s = s.sort("-published")
     s = s[paginator.slice_from : paginator.slice_to]
     return s.execute()
-- 
GitLab