@receiver(check_student_info)<EOL>def checkVoucherCode(sender,**kwargs):
logger.debug('<STR_LIT>')<EOL>formData = kwargs.get('<STR_LIT>',{})<EOL>request = kwargs.get('<STR_LIT>',{})<EOL>registration = kwargs.get('<STR_LIT>',None)<EOL>session = getattr(request,'<STR_LIT>',{}).get(REG_VALIDATION_STR,{})<EOL>id = formData.get('<STR_LIT>','<STR_LIT>')<EOL>first = formData.get('<STR_LIT>')<EOL>last = formData.get('<STR_LIT>')<EOL>email = formData.get('<STR_LIT:email>')<EOL>session.pop('<STR_LIT>',<NUM_LIT:0>)<EOL>session.pop('<STR_LIT>',None)<EOL>session.pop('<STR_LIT>',None)<EOL>if id == '<STR_LIT>':<EOL><INDENT>return<EOL><DEDENT>if not getConstant('<STR_LIT>'):<EOL><INDENT>raise ValidationError({'<STR_LIT>': _('<STR_LIT>')})<EOL><DEDENT>if session.get('<STR_LIT>','<STR_LIT>') != '<STR_LIT>':<EOL><INDENT>raise ValidationError({'<STR_LIT>': _('<STR_LIT>')})<EOL><DEDENT>eventids = [x.event.id for x in registration.temporaryeventregistration_set.exclude(dropIn=True)]<EOL>seriess = Series.objects.filter(id__in=eventids)<EOL>obj = Voucher.objects.filter(voucherId=id).first()<EOL>if not obj:<EOL><INDENT>raise ValidationError({'<STR_LIT>':_('<STR_LIT>')})<EOL><DEDENT>else:<EOL><INDENT>customer = Customer.objects.filter(<EOL>first_name=first,<EOL>last_name=last,<EOL>email=email).first()<EOL>try:<EOL><INDENT>obj.validateForCustomerAndSeriess(customer,seriess)<EOL><DEDENT>except ValidationError as e:<EOL><INDENT>raise ValidationError({'<STR_LIT>': e})<EOL><DEDENT><DEDENT>return<EOL>
Check that the given voucher code is valid