Prevent ConditionsField.choice_kwargs from being shared across instances.
Review Request #10408 — Created Feb. 15, 2019 and submitted
ConditionsField.choice_kwargs, which is used to provide custom values
to pass toConditionChoiceinstances (for request state or anything
else) was getting shared across multipleConditionsFields for multiple
instances of the same form. The reason is that thechoice_kwargs
wasn't being copied whenFormcreates instance-specific copies of its
declared form fields.We now perform the copy, but in the widget (which previously shared
ConditionsField's version).ConditionsFieldno longer keeps its own
copy, but instead provides a property that wraps the one in the widget.
This ensures there's only ever one version ofchoice_kwargsthat has
to be managed per field per form instance, and that it's always unique
to that instance.
Unit tests pass.
Verified this fixed a bug I was hitting in Review Board unit tests.