Rework and fix text types for custom fields.

Review Request #6530 — Created Oct. 29, 2014 and submitted

Information

Review Board
release-2.0.x
417fdd1...

Reviewers

Custom review request fields were pretty broken. We tried to write the
<fieldname>_rich_text= value in requests, but had a bug causing the
wrong key to be generated.

This was also designed in a way that resulted in some inconsistencies
with the rest of the API, with the goal of making things consistent with
the database models. Instead of accepting a text_type= string in
requests, we'd accept a rich_text= boolean, which differed from other
text fields.

The API would still return a custom text_type= value in the extra_data
payload, to help, but that would sit along the rich_text=, and would be
inconsistent when forcing text types.

We now use text_type everywhere. Things are much simpler now.

Unit tests pass.

Tried changing values for a custom field in the UI. Saw that the proper
values were saved to the database, and that they were used as a basis
for rendering when forcing text types in a request.

reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/reviews/fields.py
        reviewboard/webapi/mixins.py
    
    Ignored Files:
        reviewboard/static/rb/js/models/tests/reviewRequestEditorModelTests.js
        reviewboard/static/rb/js/models/reviewRequestEditorModel.js
        reviewboard/static/rb/js/views/reviewRequestEditorView.js
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/reviews/fields.py
        reviewboard/webapi/mixins.py
    
    Ignored Files:
        reviewboard/static/rb/js/models/tests/reviewRequestEditorModelTests.js
        reviewboard/static/rb/js/models/reviewRequestEditorModel.js
        reviewboard/static/rb/js/views/reviewRequestEditorView.js
    
    
  2. 
      
david
  1. Ship It!

  2. 
      
chipx86
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to markdown-redesign (38cc4fa)
Loading...