From a950a9bccefd5892b5a518c22b7d7de1ca723433 Mon Sep 17 00:00:00 2001 From: Phill Date: Tue, 6 Aug 2019 22:33:43 +0100 Subject: [PATCH] fixes --- openlp/plugins/bibles/lib/__init__.py | 2 ++ openlp/plugins/bibles/lib/db.py | 1 + tests/functional/openlp_core/lib/test_theme.py | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/openlp/plugins/bibles/lib/__init__.py b/openlp/plugins/bibles/lib/__init__.py index e6f6620c1..b0d5189e1 100644 --- a/openlp/plugins/bibles/lib/__init__.py +++ b/openlp/plugins/bibles/lib/__init__.py @@ -330,6 +330,8 @@ def parse_reference(reference, bible, language_selection, book_ref_id=False): book_ref_ids = bible.get_book_ref_id_by_localised_name(book, language_selection) elif not bible.get_book_by_book_ref_id(book_ref_id): return [] + else: + book_ref_ids = [book_ref_id] # We have not found the book so do not continue if not book_ref_ids: return [] diff --git a/openlp/plugins/bibles/lib/db.py b/openlp/plugins/bibles/lib/db.py index ce14641e5..5a629d14e 100644 --- a/openlp/plugins/bibles/lib/db.py +++ b/openlp/plugins/bibles/lib/db.py @@ -318,6 +318,7 @@ class BibleDB(Manager): db_books = self.get_books(book) return [db_book.book_reference_id for db_book in db_books] else: + book_list = [] if language_selection == LanguageSelection.Application: books = [key for key in list(book_names.keys()) if regex_book.match(book_names[key])] book_list = [_f for _f in map(BiblesResourcesDB.get_book, books) if _f] diff --git a/tests/functional/openlp_core/lib/test_theme.py b/tests/functional/openlp_core/lib/test_theme.py index e294e5214..800e9c584 100644 --- a/tests/functional/openlp_core/lib/test_theme.py +++ b/tests/functional/openlp_core/lib/test_theme.py @@ -182,4 +182,4 @@ class TestTheme(TestCase): assert 0 == theme.display_vertical_align, 'display_vertical_align should be 0' assert theme.font_footer_bold is False, 'font_footer_bold should be False' assert 'Arial' == theme.font_main_name, 'font_main_name should be "Arial"' - assert 47 == len(theme.__dict__), 'The theme should have 47 attributes' + assert 48 == len(theme.__dict__), 'The theme should have 48 attributes'