BryanDavis has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/364140 )
Change subject: Show message when duplicate SUL attach occurs
......................................................................
Show message when duplicate SUL attach occurs
Bug: T164847
Change-Id: I7770b04626d6a04019996e25658695df4bc5bedf
---
M striker/labsauth/views.py
1 file changed, 9 insertions(+), 0 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/labs/striker
refs/changes/40/364140/1
diff --git a/striker/labsauth/views.py b/striker/labsauth/views.py
index 0898228..a12ef48 100644
--- a/striker/labsauth/views.py
+++ b/striker/labsauth/views.py
@@ -27,6 +27,7 @@
from django.contrib.auth import views as auth_views
from django.core import urlresolvers
from django.db.utils import DatabaseError
+from django.db.utils import IntegrityError
from django.utils.six.moves.urllib.parse import urlparse
from django.utils.translation import ugettext_lazy as _
from django.views.decorators.cache import never_cache
@@ -151,6 +152,14 @@
messages.info(
req, _("Updated OAuth credentials for {user}".format(
user=sul_user['username'])))
+ except IntegrityError:
+ logger.exception('user.save failed')
+ messages.error(
+ req,
+ _(
+ 'Wikimedia account "{sul}" is already attached '
+ 'to another LDAP account.'
+ ).format(sul=sul_user['username']))
except DatabaseError:
logger.exception('user.save failed')
messages.error(
--
To view, visit https://gerrit.wikimedia.org/r/364140
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I7770b04626d6a04019996e25658695df4bc5bedf
Gerrit-PatchSet: 1
Gerrit-Project: labs/striker
Gerrit-Branch: master
Gerrit-Owner: BryanDavis <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits