Override validation for CommaSeparatedValuesField.

Review Request #14350 — Created Feb. 17, 2025 and submitted

Information

Djblets
release-5.x

Reviewers

The new comma separated values field that replaced the old
django-multiselectfield dependency was falling back on the base field
validation, which wasn't handling choices correctly. This change adds an
override so we actually iterate through the value instead of just
checking it directly.

Verified that saving changes to a comma-separated values field using a
multi checkbox widget worked correctly.

Summary ID
Override validation for CommaSeparatedValuesField.
The new comma separated values field that replaced the old django-multiselectfield dependency was falling back on the base field validation, which wasn't handling choices correctly. This change adds an override so we actually iterate through the value instead of just checking it directly. Testing Done: Verified that saving changes to a comma-separated values field using a multi checkbox widget worked correctly.
49ea0fc4c63a7ee9ce186c0bb5b1ec9d046fe818
Description From Last Updated

Could we add unit tests for this?

maubinmaubin

Let's make this a set. That'll be faster than scanning the whole list for every item in value.

chipx86chipx86
There are no open issues
maubin
  1. 
      
  2. Show all issues

    Could we add unit tests for this?

  3. 
      
david
maubin
  1. Ship It!
  2. 
      
chipx86
  1. 
      
  2. Show all issues

    Let's make this a set. That'll be faster than scanning the whole list for every item in value.

  3. 
      
david
david
chipx86
  1. Main change looks fine, but the lint rules should be their own change so they can be discussed separately from this fix.

    1. Oops, that was definitely not meant to sneak into this. I've just been playing with various rules. Will make a proposal once I've worked out the kinks.

  2. 
      
david
Review request changed
Status:
Completed
Change Summary:
Pushed to release-5.x (0165c8b)
Loading...