~cedric/newspipe

f5ec27f6fd5a2262e3429a874857f0f4517e38a1 — C├ędric Bonhomme 22 days ago 60a7fc4
fixed self deletion of account.
M newspipe/templates/profile.html => newspipe/templates/profile.html +1 -1
@@ 61,7 61,7 @@
    <br />
    <div class="row">
        <div class="col">
            <a href="/delete_account" class="btn btn-warning" onclick="return confirm('{{ _('You are going to delete your account.') }}');">{{ _('Delete your account') }}</a>
            <a href="{{ url_for('user.delete_account') }}" class="btn btn-warning" onclick="return confirm('{{ _('You are going to delete your account.') }}');">{{ _('Delete your account') }}</a>
        </div>
   </div>
</div><!-- /.container -->

M newspipe/web/views/session_mgmt.py => newspipe/web/views/session_mgmt.py +5 -1
@@ 1,6 1,7 @@
import logging
from datetime import datetime

from werkzeug.exceptions import NotFound
from flask import (
    current_app,
    flash,


@@ 56,7 57,10 @@ def on_identity_loaded(sender, identity):

@login_manager.user_loader
def load_user(user_id):
    return UserController(user_id, ignore_context=True).get(id=user_id, is_active=True)
    try:
        return UserController(user_id, ignore_context=True).get(id=user_id, is_active=True)
    except NotFound:
        pass


@current_app.before_request

M newspipe/web/views/user.py => newspipe/web/views/user.py +1 -1
@@ 201,7 201,7 @@ def delete_account():
    """
    UserController(current_user.id).delete(current_user.id)
    flash(gettext("Your account has been deleted."), "success")
    return redirect(url_for("login"))
    return redirect(url_for("logout"))


@user_bp.route("/confirm_account/<string:token>", methods=["GET"])