def done(self, form_list, **kwargs):
login(self.request, self.get_user())<EOL>redirect_to = self.request.POST.get(<EOL>self.redirect_field_name,<EOL>self.request.GET.get(self.redirect_field_name, '<STR_LIT>')<EOL>)<EOL>if not is_safe_url(url=redirect_to, allowed_hosts=[self.request.get_host()]):<EOL><INDENT>redirect_to = resolve_url(settings.LOGIN_REDIRECT_URL)<EOL><DEDENT>device = getattr(self.get_user(), '<STR_LIT>', None)<EOL>if device:<EOL><INDENT>signals.user_verified.send(sender=__name__, request=self.request,<EOL>user=self.get_user(), device=device)<EOL><DEDENT>return redirect(redirect_to)<EOL>
Login the user and redirect to the desired page.