diff --git a/canaille/account.py b/canaille/account.py index ab08be62..9432b01a 100644 --- a/canaille/account.py +++ b/canaille/account.py @@ -189,14 +189,6 @@ def profile_creation(user): ) -@bp.route("/impersonate/") -@admin_needed() -def impersonate(user, username): - u = User.get(username) or abort(404) - u.login() - return redirect(url_for("account.index")) - - @bp.route("/profile/", methods=("GET", "POST")) @user_needed() def profile_edition(user, username): @@ -316,6 +308,14 @@ def profile_delete(user, username): return redirect(url_for("account.users")) +@bp.route("/impersonate/") +@admin_needed() +def impersonate(user, username): + u = User.get(username) or abort(404) + u.login() + return redirect(url_for("account.index")) + + @bp.route("/reset", methods=["GET", "POST"]) def forgotten(): form = ForgottenPasswordForm(request.form)