diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/account/tasks.py | 5 | ||||
-rw-r--r-- | src/account/views.py | 6 | ||||
-rw-r--r-- | src/workflow/models.py | 2 |
3 files changed, 11 insertions, 2 deletions
diff --git a/src/account/tasks.py b/src/account/tasks.py index fe51974..53fbaf5 100644 --- a/src/account/tasks.py +++ b/src/account/tasks.py @@ -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'] diff --git a/src/account/views.py b/src/account/views.py index f883338..912a432 100644 --- a/src/account/views.py +++ b/src/account/views.py @@ -142,7 +142,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: diff --git a/src/workflow/models.py b/src/workflow/models.py index 4a5616e..f550a38 100644 --- a/src/workflow/models.py +++ b/src/workflow/models.py @@ -11,6 +11,7 @@ from django.template.loader import get_template from django.http import HttpResponse from django.utils import timezone +from django.db import transaction import yaml import requests @@ -559,6 +560,7 @@ class Repository(): self.el[self.RESULT] = bundle return False + @transaction.atomic # TODO: Rewrite transactions with savepoints at user level for all workflows def make_booking(self): models = self.el[self.BOOKING_MODELS] owner = self.el[self.SESSION_USER] |