Fix jira login 62/70362/1
authorSawyer Bergeron <sbergeron@iol.unh.edu>
Thu, 18 Jun 2020 16:10:27 +0000 (12:10 -0400)
committerSawyer Bergeron <sbergeron@iol.unh.edu>
Thu, 18 Jun 2020 16:10:27 +0000 (12:10 -0400)
Signed-off-by: Sawyer Bergeron <sbergeron@iol.unh.edu>
Change-Id: Ie179d2909f296291d8722f5e6c34a4cf748327de

src/account/tasks.py
src/account/views.py

index fe51974..53fbaf5 100644 (file)
@@ -26,7 +26,10 @@ def sync_jira_accounts():
         except JIRAError:
             # User can be anonymous (local django admin account)
             continue
-        user.email = user_dict['emailAddress']
+        try:
+            user.email = user_dict['emailAddress']
+        except:
+            pass
         user.userprofile.url = user_dict['self']
         user.userprofile.full_name = user_dict['displayName']
 
index d1cc813..1cb2275 100644 (file)
@@ -127,7 +127,11 @@ class JiraAuthenticatedView(RedirectView):
 
         jira = JIRA(server=settings.JIRA_URL, oauth=oauth_dict)
         username = jira.current_user()
-        email = jira.user(username).emailAddress
+        email = ""
+        try:
+            email = jira.user(username).emailAddress
+        except:
+            email = ""
         url = '/'
         # Step 3. Lookup the user or create them if they don't exist.
         try: