Skip to content


unable to catch errors.... #479

bedspax opened this Issue · 3 comments

2 participants


Hi guys, this is my view for LOGIN_ERROR_URL:

def process_login_errors(request):
from django.contrib.messages.api import get_messages
messages = get_messages(request)
for message in messages:
print message
return HttpResponse('BAD JOKE')

it print only:



I thinks the problem is here:

    msg = setting('LOGIN_ERROR_MESSAGE', None)
    if msg:
        messages.error(request, msg)
    url = backend_setting(backend, 'LOGIN_ERROR_URL', LOGIN_ERROR_URL)


Ok, gotcha. The problem is that i Have set LOGIN_ERROR_MESSAGE = True.

But I would want to know why there are this login error.. :)


That code will run when user is None for some reason, it didn't authenticated, or something else, it's not clear actually and shouldn't happen often IMO, that's why DSA uses exceptions to raise real errors. LOGIN_ERROR_MESSAGE is just a fancy text to show in that case, doesn't aim to be per-issue solution. Maybe you could track where the user becomes None in the pipeline or the auth process and raise an exception there. I'll gladly merge a pull request with that change :D


Thanks @omab as always. It's a my bad error on my custom pipeline. ;)

@bedspax bedspax closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.