Skip to content

Commit

Permalink
Code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
zuhdil committed Jul 2, 2024
1 parent e461769 commit a1521d5
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 45 deletions.
16 changes: 1 addition & 15 deletions akvo/rsr/views/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

from two_factor.utils import get_otpauth_url, totp_digits
from two_factor.forms import AuthenticationTokenForm, BackupTokenForm
from two_factor.views.core import LoginView, RedirectURLMixin, SetupCompleteView, SetupView, BackupTokensView
from two_factor.views.core import LoginView, RedirectURLMixin, SetupView, BackupTokensView
from two_factor.views.profile import DisableView


Expand Down Expand Up @@ -455,20 +455,6 @@ def get_static_device(self):
return self.request.user.staticdevice_set.get_or_create(name='backup')[0]


class SetupTwoFactorCompleteView(RedirectURLMixin, SetupCompleteView):

def get_context_data(self, **kwargs):
context: dict = super().get_context_data(**kwargs)
next_url = self.get_redirect_url()
backup_tokens_url = reverse("two_factor:backup_tokens")
setup_url = f'{backup_tokens_url}?next={next_url}' if next_url else backup_tokens_url
context.update({
"next_url": next_url,
"setup_url": setup_url,
})
return context


class TwoFactorBackupTokensView(RedirectURLMixin, BackupTokensView):

def form_valid(self, form):
Expand Down
25 changes: 0 additions & 25 deletions akvo/templates/two_factor/core/setup_complete.html

This file was deleted.

5 changes: 0 additions & 5 deletions akvo/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,6 @@
account.SetupTwoFactorView.as_view(),
name="two_factor_setup",
),
path(
"account/two_factor/setup/complete/",
account.SetupTwoFactorCompleteView.as_view(),
name="two_factor_setup_complete",
),
path(
"account/two_factor/disable/",
account.DisableTwoFactorView.as_view(),
Expand Down

0 comments on commit a1521d5

Please sign in to comment.