• 
      

    Make custom field text handling work just like model field handling.

    Review Request #6540 — Created Oct. 30, 2014 and submitted

    Information

    Review Board
    release-2.0.x
    1cb7913...

    Reviewers

    The custom text fields didn't have the same behavior that standard model
    fields had. Switching text types without setting new text didn't result
    in automatic escaping/unescaping logic, and the proper fields weren't
    being read consistently everywhere. The fields also didn't respect the
    deprecated text_type= property anymore (whereas they did in previous
    releases, before the split fields).

    We now have logic that mirrors what we do for plain text fields, and
    helps normalize the results so that there's always an entry for the text
    and an entry for the text type.

    Unit tests were updated to check custom fields when setting text types.

    Unit tests pass.

    Tested that I could change the text type field in API requests and the text
    would auto-escape/unescape.

    Tested having the text set to Markdown in extra_data, and just sending new
    text in the request. Saw it was auto-escaped.

    Tested custom fields in the UI.

    Description From Last Updated

    'EXTRA_DATA_LEN' imported but unused

    reviewbotreviewbot

    Col: 14 E713 test for membership should be 'not in'

    reviewbotreviewbot

    undefined name 'old_rich_text'

    reviewbotreviewbot
    reviewbot
    1. Tool: Pyflakes
      Processed Files:
          reviewboard/reviews/markdown_utils.py
          reviewboard/webapi/resources/review_request_draft.py
          reviewboard/webapi/mixins.py
          reviewboard/webapi/tests/test_review_request_draft.py
      
      
      
      Tool: PEP8 Style Checker
      Processed Files:
          reviewboard/reviews/markdown_utils.py
          reviewboard/webapi/resources/review_request_draft.py
          reviewboard/webapi/mixins.py
          reviewboard/webapi/tests/test_review_request_draft.py
      
      
    2. reviewboard/webapi/mixins.py (Diff revision 1)
       
       
      Show all issues
       'EXTRA_DATA_LEN' imported but unused
      
    3. reviewboard/webapi/mixins.py (Diff revision 1)
       
       
      Show all issues
      Col: 14
       E713 test for membership should be 'not in'
      
    4. reviewboard/webapi/mixins.py (Diff revision 1)
       
       
      Show all issues
       undefined name 'old_rich_text'
      
    5. 
        
    chipx86
    reviewbot
    1. Tool: Pyflakes
      Processed Files:
          reviewboard/reviews/markdown_utils.py
          reviewboard/webapi/resources/review_request_draft.py
          reviewboard/webapi/mixins.py
          reviewboard/webapi/tests/test_review_request_draft.py
      
      
      
      Tool: PEP8 Style Checker
      Processed Files:
          reviewboard/reviews/markdown_utils.py
          reviewboard/webapi/resources/review_request_draft.py
          reviewboard/webapi/mixins.py
          reviewboard/webapi/tests/test_review_request_draft.py
      
      
    2. 
        
    david
    1. Ship It!

    2. 
        
    chipx86
    Review request changed
    Status:
    Completed
    Change Summary:
    Pushed to markdown-redesign (0cd7bdd)