From a390bb7b59cabe9b300c8c290d0f8f0294485dd9 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Mon, 7 Oct 2019 21:23:25 +0200 Subject: [PATCH] factors/otp(minor): fix old URLs --- passbook/factors/otp/models.py | 2 +- .../factors/otp/templates/otp/user_settings.html | 4 ++-- passbook/factors/otp/views.py | 12 ++++++------ 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/passbook/factors/otp/models.py b/passbook/factors/otp/models.py index 74e2a54a6..b86233a20 100644 --- a/passbook/factors/otp/models.py +++ b/passbook/factors/otp/models.py @@ -16,7 +16,7 @@ class OTPFactor(Factor): form = 'passbook.factors.otp.forms.OTPFactorForm' def has_user_settings(self): - return _('OTP'), 'pficon-locked', 'passbook_otp:otp-user-settings' + return _('OTP'), 'pficon-locked', 'passbook_factors_otp:otp-user-settings' def __str__(self): return f"OTP Factor {self.slug}" diff --git a/passbook/factors/otp/templates/otp/user_settings.html b/passbook/factors/otp/templates/otp/user_settings.html index ffab10d50..c812c91d3 100644 --- a/passbook/factors/otp/templates/otp/user_settings.html +++ b/passbook/factors/otp/templates/otp/user_settings.html @@ -26,10 +26,10 @@

{% if not state %} - {% trans "Enable OTP" %} {% else %} - {% trans "Disable OTP" %} {% endif %}

diff --git a/passbook/factors/otp/views.py b/passbook/factors/otp/views.py index 84f3b7a0a..f7488da43 100644 --- a/passbook/factors/otp/views.py +++ b/passbook/factors/otp/views.py @@ -21,8 +21,8 @@ from passbook.factors.otp.utils import otpauth_url from passbook.lib.boilerplate import NeverCacheMixin from passbook.lib.config import CONFIG -OTP_SESSION_KEY = 'passbook_otp_key' -OTP_SETTING_UP_KEY = 'passbook_otp_setup' +OTP_SESSION_KEY = 'passbook_factors_otp_key' +OTP_SETTING_UP_KEY = 'passbook_factors_otp_setup' LOGGER = get_logger() class UserSettingsView(LoginRequiredMixin, TemplateView): @@ -61,7 +61,7 @@ class DisableView(LoginRequiredMixin, View): # current=True, # request=request, # send_notification=True) - return redirect(reverse('passbook_otp:otp-user-settings')) + return redirect(reverse('passbook_factors_otp:otp-user-settings')) class EnableView(LoginRequiredMixin, FormView): """View to set up OTP""" @@ -88,7 +88,7 @@ class EnableView(LoginRequiredMixin, FormView): if finished_totp_devices.exists() and finished_static_devices.exists(): messages.error(request, _('You already have TOTP enabled!')) del request.session[OTP_SETTING_UP_KEY] - return redirect('passbook_otp:otp-user-settings') + return redirect('passbook_factors_otp:otp-user-settings') request.session[OTP_SETTING_UP_KEY] = True # Check if there's an unconfirmed device left to set up totp_devices = TOTPDevice.objects.filter(user=request.user, confirmed=False) @@ -121,7 +121,7 @@ class EnableView(LoginRequiredMixin, FormView): def get_form(self, form_class=None): form = super().get_form(form_class=form_class) form.device = self.totp_device - form.fields['qr_code'].initial = reverse('passbook_otp:otp-qr') + form.fields['qr_code'].initial = reverse('passbook_factors_otp:otp-qr') tokens = [(x.token, x.token) for x in self.static_device.token_set.all()] form.fields['tokens'].choices = tokens return form @@ -142,7 +142,7 @@ class EnableView(LoginRequiredMixin, FormView): # current=True, # request=self.request, # send_notification=True) - return redirect('passbook_otp:otp-user-settings') + return redirect('passbook_factors_otp:otp-user-settings') class QRView(NeverCacheMixin, View): """View returns an SVG image with the OTP token information"""