aboutsummaryrefslogtreecommitdiffstats
path: root/src/account
diff options
context:
space:
mode:
Diffstat (limited to 'src/account')
-rw-r--r--src/account/models.py3
-rw-r--r--src/account/tasks.py2
-rw-r--r--src/account/views.py2
3 files changed, 4 insertions, 3 deletions
diff --git a/src/account/models.py b/src/account/models.py
index 4aab306..9624a53 100644
--- a/src/account/models.py
+++ b/src/account/models.py
@@ -16,6 +16,7 @@ import random
from collections import Counter
+
class LabStatus(object):
"""
A Poor man's enum for the status of a lab.
@@ -216,7 +217,7 @@ class Lab(models.Model):
def get_available_resources(self):
# Cannot import model normally due to ciruclar import
- Server = apps.get_model('resource_inventory', 'Server') # TODO: Find way to import ResourceQuery
+ Server = apps.get_model('resource_inventory', 'Server') # TODO: Find way to import ResourceQuery
resources = [str(resource.profile) for resource in Server.objects.filter(lab=self, booked=False)]
return dict(Counter(resources))
diff --git a/src/account/tasks.py b/src/account/tasks.py
index 53fbaf5..df98c73 100644
--- a/src/account/tasks.py
+++ b/src/account/tasks.py
@@ -28,7 +28,7 @@ def sync_jira_accounts():
continue
try:
user.email = user_dict['emailAddress']
- except:
+ except KeyError:
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 1cb2275..d11a199 100644
--- a/src/account/views.py
+++ b/src/account/views.py
@@ -130,7 +130,7 @@ class JiraAuthenticatedView(RedirectView):
email = ""
try:
email = jira.user(username).emailAddress
- except:
+ except AttributeError:
email = ""
url = '/'
# Step 3. Lookup the user or create them if they don't exist.