From 0a08a0719374f47c6a6435d5674adf181b44b13d Mon Sep 17 00:00:00 2001 From: OzzieIsaacs Date: Thu, 25 May 2017 09:09:35 +0200 Subject: [PATCH] Fixed Deleting user --- cps/db.py | 1 - cps/web.py | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cps/db.py b/cps/db.py index f79a1206..713fef34 100755 --- a/cps/db.py +++ b/cps/db.py @@ -302,7 +302,6 @@ def setup_db(): return False dbpath = os.path.join(config.config_calibre_dir, "metadata.db") - #engine = create_engine('sqlite:///{0}'.format(dbpath.encode('utf-8')), echo=False, isolation_level="SERIALIZABLE") engine = create_engine('sqlite:///'+ dbpath, echo=False, isolation_level="SERIALIZABLE") try: conn = engine.connect() diff --git a/cps/web.py b/cps/web.py index 73f87d53..1f0897f2 100755 --- a/cps/web.py +++ b/cps/web.py @@ -2359,7 +2359,8 @@ def edit_user(user_id): if request.method == "POST": to_save = request.form.to_dict() if "delete" in to_save: - ub.session.delete(content) + ub.session.query(ub.User).filter(ub.User.id == content.id).delete() + ub.session.commit() flash(_(u"User '%(nick)s' deleted", nick=content.nickname), category="success") return redirect(url_for('admin')) else: