From 4d656061becf7b92dd4de3cc9baf7460ac729386 Mon Sep 17 00:00:00 2001
From: Jason Bau <jbau@stanford.edu>
Date: Tue, 3 Sep 2013 21:31:22 -0700
Subject: [PATCH] Removing handling for ExternalAuthMap.MultipleObjectsReturned

---
 common/djangoapps/student/views.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/common/djangoapps/student/views.py b/common/djangoapps/student/views.py
index c351518335c..56d760b4b52 100644
--- a/common/djangoapps/student/views.py
+++ b/common/djangoapps/student/views.py
@@ -467,8 +467,9 @@ def login_user(request, error=""):
             eamap = ExternalAuthMap.objects.get(user=user)
             if eamap.external_domain.startswith(SHIB_DOMAIN_PREFIX):
                 return HttpResponse(json.dumps({'success': False, 'redirect': reverse('shib-login')}))
-        except (ExternalAuthMap.DoesNotExist, ExternalAuthMap.MultipleObjectsReturned):
-            pass
+        except ExternalAuthMap.DoesNotExist:
+            # This is actually the common case, logging in user without external linked login
+            log.info("User %s w/o external auth attempting login", user)
 
     # if the user doesn't exist, we want to set the username to an invalid
     # username so that authentication is guaranteed to fail and we can take
-- 
GitLab