From 3c0d165356e3da4ac23d4ba163fdb8026bac4eff Mon Sep 17 00:00:00 2001 From: Brian Moe <brian.moe@ligo.org> Date: Wed, 12 Jun 2013 14:01:41 -0500 Subject: [PATCH] Closes https://bugs.ligo.org/redmine/issues/920 REST API won't allow label creation. PUT's to /api/events/GRACEID/labels/LABELNAME fails --- gracedb/api.py | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/gracedb/api.py b/gracedb/api.py index 2055c3417..e520488da 100644 --- a/gracedb/api.py +++ b/gracedb/api.py @@ -18,6 +18,7 @@ import os import urllib import errno import shutil +import exceptions from utils.vfile import VersionedFile @@ -116,19 +117,9 @@ def reverse(name, *args, **kw): class LigoAuthentication(authentication.BaseAuthentication): def authenticate(self, request): - # XXX This might be gibberish. Esp given new LIGO.ORG auth features. - # - # LIGOAuth middleware finds you from X509 cert, but - # Shib middleware clobbers (?) the Django user in request - # and identifies you as anonymous. Need to recover the - # Django user. - user = None - try: - if request.user.is_active: - user = request.user - except: - pass - return (user, None) + # XXX This makes little sense. https://bugs.ligo.org/redmine/issues/920 + + raise exceptions.AuthenticationFailed("Bad user") class EventSerializer(serializers.ModelSerializer): -- GitLab