Fix JSON validation to accomodate JSONField data that looks like a python literal.
Review Request #5070 — Created Dec. 8, 2013 and submitted — Latest diff uploaded
Fix JSON validation to accomodate JSONField data that looks like a python literal.
Sometimes, our JSONField data will have embedded unicode markers for keys,
which isn't part of JSON but sometimes happens with python's json
serialization. We handle this in the field by using literal_eval on the data,
but the validator for form fields wasn't doing the same. I've extracted this
functionality into a method and used it for both the database field and the
validator.
Hit "save" on the reviewboard repository admin form when the
extra_data
field
had unicode markers for keys in the dictionary. Saw that it validated properly.