summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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: