Fix JSON validation to accomodate JSONField data that looks like a python literal.

Review Request #5070 — Created Dec. 8, 2013 and submitted

Information

Djblets
release-0.7.x

Reviewers

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.

chipx86
  1. Ship It!
  2. 
      
david
Review request changed
Status:
Completed
Change Summary:
Pushed to djblets release-0.7.x (ef48938).