This check isn't duplicated on the python side.

More generally, I'm sad to see all of these checks repeated in JS and Python. It would be great if we had a proper system for returning and displaying errors on particular fields. That's probably not in scope for this change, though.