Return True if the user has set a preference URL for ``pref_name`` but it failed the allowlist check. Callers use this to distinguish 'URL not configured' from 'URL configured but blocked' so the chat path can surface a clear error instead of a generic one.
(pref_name)
| 315 | |
| 316 | |
| 317 | def is_pref_api_url_rejected(pref_name): |
| 318 | """ |
| 319 | Return True if the user has set a preference URL for ``pref_name`` |
| 320 | but it failed the allowlist check. Callers use this to distinguish |
| 321 | 'URL not configured' from 'URL configured but blocked' so the chat |
| 322 | path can surface a clear error instead of a generic one. |
| 323 | """ |
| 324 | pref_url = _get_preference_value(pref_name) |
| 325 | return bool(pref_url) and not validate_api_url(pref_url) |
| 326 | |
| 327 | |
| 328 | def _resolve_pref_key_file(pref_name, config_default): |
no test coverage detected