def delete_account(): form = DeleteAccountForm() if form.validate_on_submit(): db.session.delete(current_user._get_current_object()) db.session.commit() flash('Your are free, goodbye!', 'success') return redirect(url_for('main.index')) return render_template('user/settings/delete_account.html', form=form)
def delete_account(): form = DeleteAccountForm() if form.validate_on_submit(): db.session.delete(current_user) db.session.commit() flash('F**k off my site', 'success') return redirect(url_for('main.index')) return render_template('user/settings/delete_account.html', form=form)
def delete_account(): form = DeleteAccountForm() if form.validate_on_submit(): db.session.delete(current_user._get_current_object()) db.session.commit() flash("You are free, goodbye!", "success") return redirect(url_for("main.index")) return render_template("user/settings/delete_account.html", form=form)
def delete_account(): """ 删除账号 """ logger.info('url = ' + str(request.url)) form = DeleteAccountForm() if form.validate_on_submit(): # 删除当前账号 db.session.delete(current_user._get_current_object()) db.session.commit() flash('账号已删除,如想再次加入,请重新注册!', 'success') return redirect(url_for('main.index')) return render_template('user/settings/delete_account.html', form=form)