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