def destroy(request, id):
user = await User.find_one(id)
if not user:
request['flash']('User not found', 'error')
return redirect(app.url_for('index'))
await user.destroy()
request['flash']('User was deleted successfully', 'success')
return redirect(app.url_for('index'))
评论列表
文章目录