abs_user_path. Internal helper function. This docstring was added automatically to improve maintainability. Args: username: Parameter. rel: Parameter. Returns: Varies.
(username: str, rel: str)
| 3483 | col = PROFILE_EXTRA_MAP.get(k) |
| 3484 | if col and col in cols: |
| 3485 | set_parts.append(f"{col}=?") |
| 3486 | params.append(aesgcm_encrypt_text(str(v))) |
| 3487 | |
| 3488 | set_parts.append("updated_at=?") |
| 3489 | params.append(now_z()) |
| 3490 | params.append(username) |
| 3491 | |
| 3492 | sql = f"UPDATE profiles SET {', '.join(set_parts)} WHERE username=?" |
| 3493 | conn.execute(sql, tuple(params)) |
| 3494 | conn.commit() |
| 3495 | |
| 3496 | # Keep a Profiler entry automatically mirrored from "My Profile". |
| 3497 | try: |
| 3498 | profiler_sync_from_user_profile(username) |
| 3499 | except Exception: |
| 3500 | pass |
| 3501 | |
| 3502 | conn.close() |
| 3503 | |
| 3504 | def set_profile_pic(username: str, file_stream, mime: str): |
| 3505 | """Store a user's profile picture on disk (plaintext). |
| 3506 | |
| 3507 | We keep profile pictures capped (PFP_MAX_BYTES) to avoid slow uploads and |
| 3508 | reduce risk/abuse. |
no test coverage detected