Find the role entry that belongs to a given profile user.
(meta: Dict[str, Any], user_id: str)
| 243 | |
| 244 | |
| 245 | def _find_role_entry_by_user_id(meta: Dict[str, Any], user_id: str) -> Optional[tuple[str, Dict[str, Any]]]: |
| 246 | """Find the role entry that belongs to a given profile user.""" |
| 247 | for role_name, role_info in (meta.get("roles") or {}).items(): |
| 248 | if str(role_info.get("user_id") or "").strip() == str(user_id or "").strip(): |
| 249 | return role_name, role_info |
| 250 | return None |
| 251 | |
| 252 | |
| 253 | def _direction_to_seed_phrase(direction_key: str) -> str: |
no test coverage detected