Before a code is set, the field is ''. Which matches every user that
doesn't use a discount code or voucher.
singular = 'user'
def get_list(self, instance):
- return [(r.id, r.fullname, r.invoice_status) for r in ConferenceRegistration.objects.filter(conference=instance.conference, vouchercode=instance.code)]
+ if instance.code:
+ return [(r.id, r.fullname, r.invoice_status) for r in ConferenceRegistration.objects.filter(conference=instance.conference, vouchercode=instance.code)]
+ return []
def get_form(self):
return None