From 66ecdc3c2042aa61b133316bc2ebe52dab70255a Mon Sep 17 00:00:00 2001 From: Elena ``of Valhalla'' Grandi Date: Fri, 12 Feb 2021 16:03:20 +0100 Subject: Fixes searches when default_sort isn't present. #9 --- CHANGELOG.rst | 1 + lesana/command.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 21782eb..247db4d 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -7,6 +7,7 @@ Unreleased * Fixes running on an environment where EDITOR is not set. #7 * Fixes editing an entry. #8 +* Fixes searches when default_sort isn't present. #9 0.8.0 ===== diff --git a/lesana/command.py b/lesana/command.py index 2ef52e7..9c53c9b 100644 --- a/lesana/command.py +++ b/lesana/command.py @@ -295,7 +295,8 @@ class Search(Command): # sorted results require a less efficient full search rather # than being able to use the list of all documents. if self.args.query == ['*'] and not ( - self.args.sort or collection.settings.default_sort + self.args.sort + or getattr(collection.settings, 'default_sort', False) ): results = collection.get_all_documents() else: -- cgit v1.2.3