forked from CGM_Public/pretix_original
Voucher creation: Search for duplicates based on upper version
This commit is contained in:
@@ -454,7 +454,7 @@ class Voucher(LoggedModel):
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def clean_voucher_code(data, event, pk):
|
def clean_voucher_code(data, event, pk):
|
||||||
if 'code' in data and Voucher.objects.filter(Q(code__iexact=data['code']) & Q(event=event) & ~Q(pk=pk)).exists():
|
if 'code' in data and Voucher.objects.filter(Q(code__iexact=data['code'].upper()) & Q(event=event) & ~Q(pk=pk)).exists():
|
||||||
raise ValidationError(_('A voucher with this code already exists.'))
|
raise ValidationError(_('A voucher with this code already exists.'))
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
|||||||
Reference in New Issue
Block a user