mirror of
https://github.com/rommapp/romm.git
synced 2026-12-02 18:18:47 +01:00
The scope validator and its cap were sitting in the saves DB handler, which made two endpoints the first non-test callers to import a behavioral symbol straight through the handler.database facade, for a helper with no DB content and that get_saves never calls. They belong beside the repo's other endpoint-facing validators. Fold the comma-separated ID parse into a shared parse_comma_separated_ids so the "comma-separated integers" message the tests assert on has one home, and call it from the ROM download route that already had it inline. Both scope validators now raise ValidationError like the rest of the module, which lets negotiate validate in the endpoint body next to its other request-shape checks: the two routes reject a bad scope with the same 400 instead of one returning 400 and the other 422. Also narrow the sync-record lookup to the newest row per slot (superseded rows were fetched and discarded), and share one second_rom / second_save fixture instead of three near-identical builders across the new tests. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>