Fix deleting bibles

Fixes: https://launchpad.net/bugs/1748719
This commit is contained in:
Philip Ridout 2019-03-16 21:07:44 +00:00
parent cae0c2eb09
commit 7c284ad520
2 changed files with 4 additions and 4 deletions

View File

@ -159,10 +159,10 @@ class BibleDB(Manager):
if not isinstance(self.name, str): if not isinstance(self.name, str):
self.name = str(self.name, 'utf-8') self.name = str(self.name, 'utf-8')
# TODO: To path object # TODO: To path object
file_path = Path(clean_filename(self.name) + '.sqlite') self.file_path = Path(clean_filename(self.name) + '.sqlite')
if 'file' in kwargs: if 'file' in kwargs:
file_path = kwargs['file'] self.file_path = kwargs['file']
Manager.__init__(self, 'bibles', init_schema, file_path, upgrade) Manager.__init__(self, 'bibles', init_schema, self.file_path, upgrade)
if self.session and 'file' in kwargs: if self.session and 'file' in kwargs:
self.get_name() self.get_name()
self._is_web_bible = None self._is_web_bible = None

View File

@ -187,7 +187,7 @@ class BibleManager(LogMixin, RegistryProperties):
bible = self.db_cache[name] bible = self.db_cache[name]
bible.session.close_all() bible.session.close_all()
bible.session = None bible.session = None
return delete_file(Path(bible.path, bible.file)) return delete_file(bible.path, bible.file_path)
def get_bibles(self): def get_bibles(self):
""" """