Setting preferred language to "----" fails, " Unexpected parameters: preferred_language"
Steps to reproduce:
- Visit http:///postorius/accounts/per-subscription-preferences/
- Try to set your preferred language to "----", which should inherit from your default global preference
- Submit form, receive "Unexpected parameters: preferred_language" error.
I think postorius is trying to set the language to a literal ----
instead of None.
Sidenote, the error message provided by the Mailman core REST API could use improvement:
-
----
is not a valid language code, solanguage_validator
will raise a KeyError when trying to validate it -
Validator.__call__
looks for a KeyError (for whether it's in self._converters I think) and then marks it as an unused parameter rather than saying it was invalid.
I will try to submit a patch for this later today or tomorrow.