def done(self, form_list, **kwargs):
<EOL>try:<EOL><INDENT>del self.request.session[self.session_key_name]<EOL><DEDENT>except KeyError:<EOL><INDENT>pass<EOL><DEDENT>if self.get_method() == '<STR_LIT>':<EOL><INDENT>form = [form for form in form_list if isinstance(form, TOTPDeviceForm)][<NUM_LIT:0>]<EOL>device = form.save()<EOL><DEDENT>elif self.get_method() in ('<STR_LIT>', '<STR_LIT>', '<STR_LIT>'):<EOL><INDENT>device = self.get_device()<EOL>device.save()<EOL><DEDENT>else:<EOL><INDENT>raise NotImplementedError("<STR_LIT>" % self.get_method())<EOL><DEDENT>django_otp.login(self.request, device)<EOL>return redirect(self.success_url)<EOL>
Finish the wizard. Save all forms and redirect.