Upload a file into the user vault (plaintext). Per your request, vault files are stored without encryption. (Older installs may still contain encrypted blobs; downloading them remains supported.)
()
| 11658 | "country": (request.form.get("country") or "").strip(), |
| 11659 | "state": (request.form.get("state") or "").strip(), |
| 11660 | "town": (request.form.get("town") or "").strip(), |
| 11661 | "city": (request.form.get("city") or "").strip(), |
| 11662 | "address": (request.form.get("address") or "").strip(), |
| 11663 | "family_members": _lines10(request.form.get("family_members") or ""), |
| 11664 | "close_friends": _lines10(request.form.get("close_friends") or ""), |
| 11665 | } |
| 11666 | |
| 11667 | # Basic length limits (keep DB small) |
| 11668 | for k in list(extras.keys()): |
| 11669 | extras[k] = extras[k][:200] |
| 11670 | |
| 11671 | set_profile(current_user(), nickname, bio[:800], links, extras=extras) |
| 11672 | flash("Profile saved.") |
| 11673 | return redirect(url_for("profile")) |
| 11674 | |
| 11675 | |
| 11676 | # --------------------------- |
| 11677 | # Account security: password change + security questions 2FA + recovery |
| 11678 | # --------------------------- |
| 11679 | |
| 11680 | def _norm_answer(s: str) -> str: |
| 11681 | """_norm_answer. |
| 11682 | |
| 11683 | Internal helper function. |
| 11684 | |
| 11685 | This docstring was added automatically to improve maintainability. |
| 11686 | |
| 11687 | Args: |
| 11688 | s: Parameter. |
| 11689 | |
| 11690 | Returns: |
| 11691 | Varies. |
| 11692 | """ |
| 11693 | return (s or "").strip().lower() |
| 11694 | |
| 11695 | def get_user_security(username: str) -> dict: |
| 11696 | """get_user_security. |
| 11697 | |
| 11698 | Internal helper function. |
| 11699 | |
| 11700 | This docstring was added automatically to improve maintainability. |
| 11701 | |
| 11702 | Args: |
| 11703 | username: Parameter. |
| 11704 | |
| 11705 | Returns: |
| 11706 | Varies. |
| 11707 | """ |
| 11708 | conn = db_connect() |
| 11709 | row = conn.execute("SELECT * FROM user_security WHERE username=?", (username,)).fetchone() |
nothing calls this directly
no test coverage detected