Do not store duplicate categories

This commit is contained in:
tcely 2025-02-03 08:12:09 -05:00 committed by GitHub
parent 869e04dd53
commit d1f078cf0c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -180,7 +180,7 @@ class CommaSepChoiceField(models.CharField):
return ''
if data.all_choice in value:
return data.all_choice
return data.separator.join(value)
return data.separator.join(set(reversed(value)))
# extra functions not used by any parent classes
def get_all_choices(self):