Ticket #18171: type_error_raised.2.diff

File type_error_raised.2.diff, 718 bytes (added by renatooliveira, 3 years ago)
  • django/contrib/auth/__init__.py

    diff --git a/django/contrib/auth/__init__.py b/django/contrib/auth/__init__.py
    index 0b3ccf7..bde2137 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)
    4343        if user is None:
    4444            continue
    4545        # Annotate the user object with the path of the backend.
Back to Top