def dispatch(self,request,*args,**kwargs):
regSession = self.request.session.get(REG_VALIDATION_STR,{})<EOL>if not regSession:<EOL><INDENT>return HttpResponseRedirect(reverse('<STR_LIT>'))<EOL><DEDENT>try:<EOL><INDENT>reg = 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>kwargs.update({<EOL>'<STR_LIT>': reg,<EOL>})<EOL>return super(RegistrationSummaryView,self).dispatch(request, *args, **kwargs)<EOL>
Always check that the temporary registration has not expired