Voucher get code validation

This commit is contained in:
Raphael Michel
2024-05-03 14:34:51 +02:00
parent 0d57673a47
commit 806124304a
2 changed files with 2 additions and 2 deletions

View File

@@ -44,8 +44,6 @@ class CodeColumn(ImportColumn):
super().__init__(*args)
def clean(self, value, previous_values):
if not value:
raise ValidationError(_('A voucher cannot be created without a code.'))
if value:
MinLengthValidator(5)(value)
if value and (value in self._cached or Voucher.objects.filter(event=self.event, code=value).exists()):