| 1 | -from django.core.exceptions import ImproperlyConfigured
|
|---|
| 2 | +from django.core.exceptions import ImproperlyConfigured, PermissionDenied
|
|---|
| 3 |
|
|---|
| 4 | SESSION_KEY = '_auth_user_id'
|
|---|
| 5 | BACKEND_SESSION_KEY = '_auth_user_backend'
|
|---|
| 6 | @@ -35,6 +35,9 @@
|
|---|
| 7 | except TypeError:
|
|---|
| 8 | # This backend doesn't accept these credentials as arguments. Try the next one.
|
|---|
| 9 | continue
|
|---|
| 10 | + except PermissionDenied:
|
|---|
| 11 | + # This backend says to stop in our tracks - this user should not be allowed in at all.
|
|---|
| 12 | + return None
|
|---|
| 13 | if user is None:
|
|---|
| 14 | continue
|
|---|
| 15 | # Annotate the user object with the path of the backend.
|
|---|