admin_panel. Admin-only route handler. This docstring was expanded to make future maintenance easier. Returns: Varies.
()
| 12007 | """Update UI appearance settings (theme style, accent color, font) for the current user.""" |
| 12008 | me = current_user() |
| 12009 | accent = (request.form.get("accent") or "").strip() |
| 12010 | font = (request.form.get("font") or "").strip() |
| 12011 | ui_theme = (request.form.get("ui_theme") or "").strip() |
| 12012 | set_user_prefs(me, accent, font, ui_theme) |
| 12013 | flash("Appearance updated.") |
| 12014 | return redirect(url_for("settings_appearance_page")) |
| 12015 | |
| 12016 | @app.route("/recover", methods=["GET", "POST"]) |
| 12017 | def recover(): |
| 12018 | """recover. |
| 12019 | |
| 12020 | Internal helper function. |
| 12021 | |
| 12022 | This docstring was added automatically to improve maintainability. |
| 12023 | |
| 12024 | Returns: |
| 12025 | Varies. |
| 12026 | """ |
| 12027 | # Password recovery using security questions |
| 12028 | if request.method == "GET": |
| 12029 | return render_template("recover.html", title="Recover") |
| 12030 | |
| 12031 | ip = _client_ip() or "?" |
| 12032 | if _rate_limit_hit("recover_post", ip, limit=10, window_sec=1800): |
| 12033 | flash("Too many recovery attempts. Try again later.") |
| 12034 | return render_template("recover.html", title="Recover") |
| 12035 | |
| 12036 | step = request.form.get("step") or "user" |
| 12037 | username = (request.form.get("username") or "").strip() |
| 12038 | |
| 12039 | if step == "user": |
| 12040 | if not username: |
| 12041 | flash("Username is required.") |
| 12042 | return render_template("recover.html", title="Recover") |
| 12043 | conn = db_connect() |
nothing calls this directly
no test coverage detected