Fix change user (in case of reboot required)

Fix no existing database
Update required version for sqlalchemy
This commit is contained in:
Ozzie Isaacs 2018-07-28 17:19:08 +02:00
parent 9d161129d9
commit 6a76dce870
3 changed files with 5 additions and 2 deletions

View File

@ -318,8 +318,10 @@ def setup_db():
return False
dbpath = os.path.join(config.config_calibre_dir, "metadata.db")
engine = create_engine('sqlite:///' + dbpath, echo=False, isolation_level="SERIALIZABLE")
try:
if not os.path.exists(dbpath):
raise
engine = create_engine('sqlite:///' + dbpath, echo=False, isolation_level="SERIALIZABLE")
conn = engine.connect()
except Exception:
content = ub.session.query(ub.Settings).first()

View File

@ -2491,6 +2491,7 @@ def configuration():
@login_required
@admin_required
def view_configuration():
reboot_required = False
if request.method == "POST":
to_save = request.form.to_dict()
content = ub.session.query(ub.Settings).first()

View File

@ -9,7 +9,7 @@ iso-639>=0.4.5
PyPDF2==1.26.0
pytz>=2016.10
requests>=2.11.1
SQLAlchemy>=0.8.4
SQLAlchemy>=1.1.0
tornado>=4.1
Wand>=0.4.4
unidecode>=0.04.19