This commit is contained in:
Phill 2019-08-06 22:33:43 +01:00
parent 5c2b70ff07
commit a950a9bcce
3 changed files with 4 additions and 1 deletions

View File

@ -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) 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): elif not bible.get_book_by_book_ref_id(book_ref_id):
return [] return []
else:
book_ref_ids = [book_ref_id]
# We have not found the book so do not continue # We have not found the book so do not continue
if not book_ref_ids: if not book_ref_ids:
return [] return []

View File

@ -318,6 +318,7 @@ class BibleDB(Manager):
db_books = self.get_books(book) db_books = self.get_books(book)
return [db_book.book_reference_id for db_book in db_books] return [db_book.book_reference_id for db_book in db_books]
else: else:
book_list = []
if language_selection == LanguageSelection.Application: if language_selection == LanguageSelection.Application:
books = [key for key in list(book_names.keys()) if regex_book.match(book_names[key])] 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] book_list = [_f for _f in map(BiblesResourcesDB.get_book, books) if _f]

View File

@ -182,4 +182,4 @@ class TestTheme(TestCase):
assert 0 == theme.display_vertical_align, 'display_vertical_align should be 0' 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 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 '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'