Fix weird model declaration 19/70819/6
authorSean Smith <ssmith@iol.unh.edu>
Mon, 17 Aug 2020 18:25:18 +0000 (14:25 -0400)
committerAdam Hassick <ahassick@iol.unh.edu>
Fri, 4 Dec 2020 19:20:41 +0000 (14:20 -0500)
Signed-off-by: Sean Smith <ssmith@iol.unh.edu>
Change-Id: I63f2b14982ce7cf30be90cd455e396b551bbaff6

src/account/views.py

index d0cfb22..f282369 100644 (file)
@@ -61,16 +61,15 @@ class AccountSettingsView(UpdateView):
 
 class MyOIDCAB(OIDCAuthenticationBackend):
     def filter_users_by_claims(self, claims):
-        email = claims.get(email=email)
+        email = claims.get('email')
         if not email:
-            return self.UserModel.objects.none()
+            return self.User.objects.none()
 
         try:
-            profile = Profile.objects.get(email=email)
-            return profile.user
-
-        except Profile.DoesNotExist:
-            return self.UserModel.objects.none()
+            profile = UserProfile.objects.get('email')
+            return profile
+        except UserProfile.DoesNotExist:
+            return self.User.objects.none()
 
 
 class JiraLoginView(RedirectView):