flake8
passed.
JSHint
passed.
Review Request #9270 — Created Oct. 15, 2017 and submitted
JSONFormField
, used byJSONField
, knew how to take JSON data and
serialize it for use in the field, but it didn't then deserialize that
data back after cleaning the field. This didn't always matter in all
cases, but depending on how the form was constructed and validated, it
could result in validation errors or incorrect data being made available
to callers.This change implements the
to_python
method, which handles the
deserialization side. This should ensure that the resulting object is
always going to be valid JSON data (or will result in a
ValidationError
).
Unit tests pass, including new ones in Review Board that broke prior to
this fix.