Ticket #2550: auth-__init__-changed-viewable.diff

File auth-__init__-changed-viewable.diff, 917 bytes (added by umbrae@…, 14 years ago)

A (hopefully) viewable version of the previous diff

  • trunk/django/contrib/auth/__init__.py

    1 from django.core.exceptions import ImproperlyConfigured
     1from django.core.exceptions import ImproperlyConfigured, PermissionDenied
    33SESSION_KEY = '_auth_user_id'
    44BACKEND_SESSION_KEY = '_auth_user_backend'
    3535        except TypeError:
    3636            # This backend doesn't accept these credentials as arguments. Try the next one.
    3737            continue
     38        except PermissionDenied:
     39            # This backend says to stop in our tracks - this user should not be allowed in at all.
     40            return None
    3841        if user is None:
    3942            continue
    4043        # Annotate the user object with the path of the backend.
Back to Top