summaryrefslogtreecommitdiff
path: root/meetingtools
diff options
context:
space:
mode:
authorJohan Lundberg <lundberg@nordu.net>2014-10-23 13:09:19 +0200
committerJohan Lundberg <lundberg@nordu.net>2014-10-23 13:09:19 +0200
commit87deafa8caa36f4e10cc704a325700a94c7fb04e (patch)
tree2eb791d5392500694fc9e58b4dfe6c264b6d36ed /meetingtools
parentb7d9314ec9a1e318acf1c7c9ce9b15a08ed400c7 (diff)
Do not even try to authenticate if settings are missing or the user is not in settings.
Diffstat (limited to 'meetingtools')
-rw-r--r--meetingtools/apps/auth/utils.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/meetingtools/apps/auth/utils.py b/meetingtools/apps/auth/utils.py
index c792b4a..ab22340 100644
--- a/meetingtools/apps/auth/utils.py
+++ b/meetingtools/apps/auth/utils.py
@@ -27,8 +27,11 @@ def groups(request):
def report_auth(request):
auth_data = request.META.get('HTTP_X_REPORT_AUTH', None)
if auth_data and ':' in auth_data:
- report_users = getattr(django_settings, 'REPORT_USERS')
- requester, key = auth_data.split(':')
- if report_users[requester]['key'] == key:
- return report_users[requester]
+ try:
+ report_users = getattr(django_settings, 'REPORT_USERS')
+ requester, key = auth_data.split(':')
+ if report_users[requester]['key'] == key:
+ return report_users[requester]
+ except (AttributeError, KeyError):
+ pass
return False \ No newline at end of file