- Drop the os.path.isfile pre-check in the SPA catch-all; let
send_from_directory be the only gatekeeper so raw user-supplied
path segments never reach os.path.isfile on a joined path.
- Reuse the first db.get_settings result in patch_settings so a
race-induced None doesn't raise an unhandled AttributeError.