Esempio n. 1
0
def login(request):
    """
    Login the user and redirect him to the homepage

    :Rest Types: ``GET``
    :URL: ``^login/$``
    """
    if request.user.is_active:
        return HttpResponseRedirect('/')
    else:
        return base_login(request)
Esempio n. 2
0
def login_view(request):
    return base_login(request, authentication_form=AuthenticationForm)
Esempio n. 3
0
def login_view(request):
    return base_login(request, authentication_form=AuthenticationForm)
Esempio n. 4
0
def custom_login(request):
    if is_ip_banned(request):
        messages.error(request, "Your account was disabled.")
        return redirect('home')
    else:
        return base_login(request)
Esempio n. 5
0
def custom_login(request):
	if is_ip_banned(request):
		messages.error(request, "Your account was disabled.")
		return redirect('home')
	else:
		return base_login(request)