docs: def checkVoucherCode(sender,**kwargs):
      '''
      Check that the given voucher code is valid
      '''
      logger.debug('Signal to check RegistrationContactForm handled by vouchers app.')
  
      formData = kwargs.get('formData',{})
      request = kwargs.get('request',{})
      registration = kwargs.get('registration',None)
      session = getattr(request,'session',{}).get(REG_VALIDATION_STR,{})
  
      id = formData.get('gift','')
      first = formData.get('firstName')
      last = formData.get('lastName')
      email = formData.get('email')
  
      # Clean out the session data relating to vouchers so that we can revalidate it.
      session.pop('total_voucher_amount',0)
      session.pop('voucher_names',None)
      session.pop('gift',None)
  
      if id == '':
          return
  
      if not getConstant('vouchers__enableVouchers'):
          raise ValidationError({'gift': _('Vouchers are disabled.')})
  
      if session.get('gift','') != '':
          raise ValidationError({'gift': _('Can\'t have more than one voucher')})
  
      eventids = [x.event.id for x in registration.temporaryeventregistration_set.exclude(dropIn=True)]
      seriess = Series.objects.filter(id__in=eventids)
  
      obj = Voucher.objects.filter(voucherId=id).first()
      if not obj:
          raise ValidationError({'gift':_('Invalid Voucher Id')})
      else:
          customer = Customer.objects.filter(
              first_name=first,
              last_name=last,
              email=email).first()
  
          # This will raise any other errors that may be relevant
          try:
              obj.validateForCustomerAndSeriess(customer,seriess)
          except ValidationError as e:
              # Ensures that the error is applied to the correct field
              raise ValidationError({'gift': e})
  
      # If we got this far, then the voucher is determined to be valid, so the registration
      # can proceed with no errors.
      return