Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change login page to a variable setting #637

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion two_factor/views/mixins.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from django.conf import settings
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.contrib.auth.views import redirect_to_login
from django.core.exceptions import PermissionDenied
Expand Down Expand Up @@ -46,7 +47,12 @@ def get_login_url(self):
"""
Returns login url to redirect to.
"""
return self.login_url and str(self.login_url) or reverse('two_factor:login')
login_redirect = 'two_factor:login'

if settings.LOGIN_URL:
login_redirect = settings.LOGIN_URL

return self.login_url and str(self.login_url) or reverse(login_redirect)

def get_verification_url(self):
"""
Expand Down