• 
      

    Fix regressions with comma-separated field change description rendering.

    Review Request #14965 — Created March 26, 2026 and submitted — Latest diff uploaded

    Information

    Review Board
    release-7.1.x

    Reviewers

    The SafeString change at /r/14299 introduced some regressions with
    rendering changes to comma-separated fields. After deploying, we were
    getting a bunch of IndexError crashes trying to render when the added
    or removed list was empty. My initial fix for this was to use
    walrus-operators to check the truthiness of those values before doing
    anything else.

    This exposed another issue with the change, which was that the inner
    [values] caused entries to be double-wrapped, which ended up making it
    so we'd show only the first item in the added or changed list, but then
    rendering it as a python list repr instead. For example, a change that
    added bugs 123 and 456 would show "Bugs: + ['123']". Really what needs
    to happen is going back to the previous implementation with separate
    branches for the single-line and multi-line modes.

    • Added a test class for the BugsField. Verified that these tests failed
      before the change, and succeeded afterward.
    • Verified that added and removed items in BaseCommaSeparatedField
      subclasses rendered correctly, including both the one-per-line and the
      combined mode (specifically tested bugs, users, and file attachments).

    Commits

    Files