remove_profile_pic. Route handler or application helper. This docstring was expanded to make future maintenance easier. Args: username: Parameter. Returns: Varies.
(username: str)
| 3414 | prof["bio"] = aesgcm_decrypt_text(row["bio_enc"]) |
| 3415 | except Exception: |
| 3416 | pass |
| 3417 | try: |
| 3418 | if row["links_enc"]: |
| 3419 | prof["links"] = json.loads(aesgcm_decrypt_text(row["links_enc"]) or "[]") |
| 3420 | except Exception: |
| 3421 | pass |
| 3422 | |
| 3423 | # Optional fields (only if columns exist) |
| 3424 | try: |
| 3425 | keys = set(row.keys()) |
| 3426 | for k, col in PROFILE_EXTRA_MAP.items(): |
| 3427 | if col in keys and row[col]: |
| 3428 | try: |
| 3429 | prof[k] = aesgcm_decrypt_text(row[col]) |
| 3430 | except Exception: |
| 3431 | pass |
| 3432 | except Exception: |
| 3433 | pass |
| 3434 | |
| 3435 | try: |
| 3436 | prof["has_pic"] = bool(row["pic_path"] and os.path.exists(row["pic_path"])) |
| 3437 | except Exception: |
| 3438 | prof["has_pic"] = False |
| 3439 | try: |
| 3440 | prof["pic_mime"] = row["pic_mime"] |
| 3441 | except Exception: |
| 3442 | prof["pic_mime"] = None |
| 3443 | return prof |
no test coverage detected