Skip to content

Commit

Permalink
Fix change user (in case of reboot required)
Browse files Browse the repository at this point in the history
Fix no existing database
Update required version for sqlalchemy
  • Loading branch information
Ozzie Isaacs committed Jul 28, 2018
1 parent 9d16112 commit 6a76dce
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion cps/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
1 change: 1 addition & 0 deletions cps/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 6a76dce

Please sign in to comment.