def dispatch(self, request, *args, **kwargs):
if REG_VALIDATION_STR not in request.session:<EOL><INDENT>return HttpResponseRedirect(reverse('<STR_LIT>'))<EOL><DEDENT>try:<EOL><INDENT>self.temporaryRegistration = TemporaryRegistration.objects.get(<EOL>id=self.request.session[REG_VALIDATION_STR].get('<STR_LIT>')<EOL>)<EOL><DEDENT>except ObjectDoesNotExist:<EOL><INDENT>messages.error(request,_('<STR_LIT>'))<EOL>return HttpResponseRedirect(reverse('<STR_LIT>'))<EOL><DEDENT>expiry = parse_datetime(<EOL>self.request.session[REG_VALIDATION_STR].get('<STR_LIT>','<STR_LIT>'),<EOL>)<EOL>if not expiry or expiry < timezone.now():<EOL><INDENT>messages.info(request,_('<STR_LIT>'))<EOL>return HttpResponseRedirect(reverse('<STR_LIT>'))<EOL><DEDENT>return super(StudentInfoView,self).dispatch(request,*args,**kwargs)<EOL>
Require session data to be set to proceed, otherwise go back to step 1.
Because they have the same expiration date, this also implies that the
TemporaryRegistration object is not yet expired.