Deleted book formats remove book from synced to kobo table
updated teststatus
This commit is contained in:
@@ -773,6 +773,14 @@ def create_admin_user(session):
|
||||
except Exception:
|
||||
session.rollback()
|
||||
|
||||
def ini():
|
||||
global app_DB_path
|
||||
engine = create_engine(u'sqlite:///{0}'.format(app_DB_path), echo=False)
|
||||
|
||||
Session = scoped_session(sessionmaker())
|
||||
Session.configure(bind=engine)
|
||||
return Session()
|
||||
|
||||
|
||||
def init_db(app_db_path):
|
||||
# Open session for database connection
|
||||
@@ -830,12 +838,13 @@ def dispose():
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
def session_commit(success=None):
|
||||
def session_commit(success=None, sess=None):
|
||||
s = sess if sess else session
|
||||
try:
|
||||
session.commit()
|
||||
s.commit()
|
||||
if success:
|
||||
log.info(success)
|
||||
except (exc.OperationalError, exc.InvalidRequestError) as e:
|
||||
session.rollback()
|
||||
s.rollback()
|
||||
log.debug_or_exception(e)
|
||||
return ""
|
||||
|
||||
Reference in New Issue
Block a user