diff --git a/app/blueprints/users/settings.py b/app/blueprints/users/settings.py index b2636d4a..b4d7153f 100644 --- a/app/blueprints/users/settings.py +++ b/app/blueprints/users/settings.py @@ -145,11 +145,13 @@ def handle_email_notifications(user, prefs, is_new, form): return redirect(url_for("users.email_notifications", username=user.username)) - - +@bp.route("/user/settings/email/") @bp.route("/users//settings/email/", methods=["GET", "POST"]) @login_required -def email_notifications(username): +def email_notifications(username=None): + if username is None: + return redirect(url_for("users.email_notifications", username=current_user.username)) + user: User = User.query.filter_by(username=username).first() if not user: abort(404)