fixup: empty lists should work too

This commit is contained in:
tcely authored and GitHub committed 2025-04-14 19:52:44 -04:00
1 parent 1d153954bc
commit 44a940faee
1 file changed
+1 -1
+1 -1
View File
@@ -79,7 +79,7 @@ class CommaSepChoiceField(models.CharField):
arg_was_none = True if value is None else False
if isinstance(value, CommaSepChoice):
return value.selected_choices
if isinstance(value, list) and value[0].startswith('CommaSepChoice('):
if isinstance(value, list) and len(value) and value[0].startswith('CommaSepChoice('):
saved_value = value
value = ''.join(value)
if isinstance(value, str) and value.startswith('CommaSepChoice('):