Backport patch that will hopefully address #781

This commit is contained in:
Garret Wassermann 2019-12-24 04:02:02 -05:00
parent 542138c294
commit 2d129d0e31

View File

@ -11,7 +11,7 @@ default_login_view = auth_views.LoginView.as_view(
def login(request):
login_url = settings.LOGIN_URL
# Prevent redirect loop by checking that LOGIN_URL is not this view's name
if login_url and login_url != request.resolver_match.view_name:
if login_url and (login_url != resolve_url(request.resolver_match.view_name) and (login_url != request.resolver_match.view_name)):
if 'next' in request.GET:
return_to = request.GET['next']
else: