aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElena ``of Valhalla'' Grandi <valhalla@trueelena.org>2021-02-12 16:03:20 +0100
committerElena ``of Valhalla'' Grandi <valhalla@trueelena.org>2021-02-12 16:03:20 +0100
commit66ecdc3c2042aa61b133316bc2ebe52dab70255a (patch)
tree3c558949124abe6f8fc669a7373698ec2c85986f
parent93c0c15812fde8c113b4141004de130a5ff328ad (diff)
Fixes searches when default_sort isn't present. #9
-rw-r--r--CHANGELOG.rst1
-rw-r--r--lesana/command.py3
2 files changed, 3 insertions, 1 deletions
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: