a few changes post merge

This commit is contained in:
David Kennedy 2024-07-23 09:29:44 -04:00
parent dea3efc9c7
commit f96d9bcf3c
No known key found for this signature in database
GPG key ID: 6528A5386E66B96B
2 changed files with 13 additions and 6 deletions

View file

@ -107,6 +107,8 @@ class FilteredSelectMultipleArrayWidget(FilteredSelectMultiple):
value = []
elif isinstance(value, str):
value = value.split(",")
# alter self.choices to be a list of selected and unselected choices, based on value;
# order such that selected choices come before unselected choices
self.choices = [(choice, label) for choice, label in self.choices if choice in value] + [
(choice, label) for choice, label in self.choices if choice not in value
]