From 62920fef8b25c54f5e3cad14fd3b258133b23f71 Mon Sep 17 00:00:00 2001 From: ibuler Date: Tue, 14 Dec 2021 11:10:32 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20otp=20=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E6=97=B6=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit 19ecc7fef62586e78f8aa3ff1f6d42c02cb519ec) --- apps/users/views/profile/otp.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/users/views/profile/otp.py b/apps/users/views/profile/otp.py index b26af285a..fec3055e6 100644 --- a/apps/users/views/profile/otp.py +++ b/apps/users/views/profile/otp.py @@ -39,7 +39,8 @@ class UserOtpEnableStartView(AuthMixin, TemplateView): try: self.get_user_from_session() except SessionEmptyError: - return redirect('authentication:login') + '?_=otp_enable_start' + url = reverse('authentication:login') + '?_=otp_enable_start' + return redirect(url) return super().get(request, *args, **kwargs) @@ -72,8 +73,8 @@ class UserOtpEnableBindView(AuthMixin, TemplateView, FormView): def _pre_check_can_bind(self): try: user = self.get_user_from_session() - except: - verify_url = reverse('authentication:user-otp-enable-start') + except Exception as e: + verify_url = reverse('authentication:user-otp-enable-start') + f'?e={e}' return HttpResponseRedirect(verify_url) if user.otp_secret_key: