0001-auth_saml-report-mapping-errors-to-users-50834.patch
src/authentic2_auth_saml/adapters.py | ||
---|---|---|
19 | 19 |
import logging |
20 | 20 | |
21 | 21 |
from django.utils import six |
22 |
from django.contrib import messages |
|
22 | 23 |
from django.core.exceptions import MultipleObjectsReturned |
23 | 24 |
from django.db.transaction import atomic |
25 |
from django.utils.translation import ugettext as _ |
|
24 | 26 | |
25 | 27 |
from mellon.adapters import DefaultAdapter, UserCreationError |
26 | 28 |
from mellon.utils import get_setting |
... | ... | |
74 | 76 |
try: |
75 | 77 |
self.provision_a2_attributes(user, idp, saml_attributes) |
76 | 78 |
except MappingError as e: |
79 |
if self.request: |
|
80 |
messages.error(self.request, _('SSO failed with this error: %s') % e) |
|
77 | 81 |
raise UserCreationError('user creation failed on a mandatory mapping action: %s' % e) |
78 | 82 |
if not user.ou: |
79 | 83 |
user.ou = get_default_ou() |
80 |
- |