mirror of
				https://github.com/janeczku/calibre-web
				synced 2025-10-31 15:23:02 +00:00 
			
		
		
		
	Fixed Deleting user
This commit is contained in:
		| @@ -302,7 +302,6 @@ def setup_db(): | |||||||
|         return False |         return False | ||||||
|  |  | ||||||
|     dbpath = os.path.join(config.config_calibre_dir, "metadata.db") |     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") |     engine = create_engine('sqlite:///'+ dbpath, echo=False, isolation_level="SERIALIZABLE") | ||||||
|     try: |     try: | ||||||
|         conn = engine.connect() |         conn = engine.connect() | ||||||
|   | |||||||
| @@ -2359,7 +2359,8 @@ def edit_user(user_id): | |||||||
|     if request.method == "POST": |     if request.method == "POST": | ||||||
|         to_save = request.form.to_dict() |         to_save = request.form.to_dict() | ||||||
|         if "delete" in to_save: |         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") |             flash(_(u"User '%(nick)s' deleted", nick=content.nickname), category="success") | ||||||
|             return redirect(url_for('admin')) |             return redirect(url_for('admin')) | ||||||
|         else: |         else: | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 OzzieIsaacs
					OzzieIsaacs