Add support for fine-grained rich text for custom fields.
Review Request #6463 — Created Oct. 18, 2014 and submitted
Custom fields now work properly with fine-grained rich text fields.
When loading an old field, the rich text setting won't exist in
extra_data, so we assume rich_text should be true. This is because in
2.0.x, pre-2.0.9, all fields were saved as Markdown by default.When saving a field, we now set the appropriate rich_text field along
with it, and when loading, we look for that field. We also escape if it
exists and is set to False.
Loaded an old review request with the Note to Reviewers field. Saw that it
appeared as rendered Markdown, despite not having the rich_text value.Saved the text and saw it render as Markdown and save the rich_text value.
Tweaked that value to false in the database. Loaded and saw it appear as
escaped Markdown text. Saving again turned it into Markdown.
- Change Summary:
-
Fixed unit tests.
- Commit:
-
bc4ff82f1a661b72e4c323182330436224d6fc686ff2f0f20bddbf4999bde73c56bd4aa4b7b4d71c
-
Tool: Pyflakes Processed Files: reviewboard/webapi/base.py reviewboard/webapi/tests/mixins_extra_data.py reviewboard/reviews/fields.py reviewboard/webapi/mixins.py Ignored Files: reviewboard/static/rb/js/models/reviewRequestEditorModel.js reviewboard/static/rb/js/views/reviewRequestEditorView.js Tool: PEP8 Style Checker Processed Files: reviewboard/webapi/base.py reviewboard/webapi/tests/mixins_extra_data.py reviewboard/reviews/fields.py reviewboard/webapi/mixins.py Ignored Files: reviewboard/static/rb/js/models/reviewRequestEditorModel.js reviewboard/static/rb/js/views/reviewRequestEditorView.js