Ticket #18171: type_error_raised.3.diff

File type_error_raised.3.diff, 861 bytes (added by Renato Oliveira, 12 years ago)

Just correcting a mistake

  • django/contrib/auth/__init__.py

    diff --git a/django/contrib/auth/__init__.py b/django/contrib/auth/__init__.py
    index 0b3ccf7..0feab15 100644
    a b def authenticate(**credentials):  
    3737    for backend in get_backends():
    3838        try:
    3939            user = backend.authenticate(**credentials)
    40         except TypeError:
    41             # This backend doesn't accept these credentials as arguments. Try the next one.
    42             continue
     40        except TypeError as e:
     41            if not 'argument' in e.message
     42                raise TypeError(e.message)
     43            else:
     44                # This backend doesn't accept these credentials as arguments. Try the next one.
     45                continue
    4346        if user is None:
    4447            continue
    4548        # Annotate the user object with the path of the backend.
Back to Top