diff --git a/openlp/core/lib/db.py b/openlp/core/lib/db.py index 935b94bb9..e089cd8a4 100644 --- a/openlp/core/lib/db.py +++ b/openlp/core/lib/db.py @@ -384,8 +384,6 @@ class Manager(object): :param object_class: The type of objects to return. :param filter_clause: The filter governing selection of objects to return. Defaults to None. """ - if not self.session: - return query = self.session.query(object_class) if filter_clause is not None: query = query.filter(filter_clause) diff --git a/openlp/plugins/bibles/lib/db.py b/openlp/plugins/bibles/lib/db.py index 00f4832db..5c8443f23 100644 --- a/openlp/plugins/bibles/lib/db.py +++ b/openlp/plugins/bibles/lib/db.py @@ -145,8 +145,7 @@ class BibleDB(QtCore.QObject, Manager, RegistryProperties): if 'file' in kwargs: self.file = kwargs['file'] Manager.__init__(self, 'bibles', init_schema, self.file, upgrade) - if self.session: - if 'file' in kwargs: + if self.session and 'file' in kwargs: self.get_name() if 'path' in kwargs: self.path = kwargs['path']