diff --git a/middleware/cli.py b/middleware/cli.py new file mode 100644 index 0000000000000000000000000000000000000000..5f750d38bd532a87eb5a806579c4e5fae8cc5d63 --- /dev/null +++ b/middleware/cli.py @@ -0,0 +1,15 @@ + +from django.http import HttpResponse + +class CliExceptionMiddleware(object): + def process_exception(self, request, exception): + if 'cli_version' in request.POST: + response = HttpResponse(mimetype='application/json') + # XXX JSON + msg = str({ 'error': "Server exception: %s" % str(exception) }) + response.write(msg) + response['Content-length'] = len(msg) + return response + else: + return None + diff --git a/settings.py b/settings.py index 7d7d4bb342e98fbeb9edc15b8390d461e00f0521..50f7bcd0155789ace52ec81c947bd84282d6cf08 100644 --- a/settings.py +++ b/settings.py @@ -91,6 +91,7 @@ AUTHENTICATION_BACKENDS = ('gracedb.middleware.auth.LigoAuthBackend',) MIDDLEWARE_CLASSES = ( 'gracedb.middleware.accept.AcceptMiddleware', 'gracedb.middleware.auth.LigoAuthMiddleware', + 'gracedb.middleware.cli.CliExceptionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', diff --git a/settings_dev.py b/settings_dev.py index 8baa7da37489051962d17d32a50f08d89c8e68bb..3c03f0fe506afd9762fc73c7b29fed68f1849919 100644 --- a/settings_dev.py +++ b/settings_dev.py @@ -83,6 +83,7 @@ AUTHENTICATION_BACKENDS = ('gracedb.middleware.auth.LigoAuthBackend',) MIDDLEWARE_CLASSES = ( 'gracedb.middleware.accept.AcceptMiddleware', 'gracedb.middleware.auth.LigoAuthMiddleware', + 'gracedb.middleware.cli.CliExceptionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', diff --git a/static/css/admin-nav.css b/static/css/admin-nav.css index 26cef176129dff18b0616a864546317453580ee6..3a309536fbb08cfe2d346e6df41bc7c6ef760015 100644 --- a/static/css/admin-nav.css +++ b/static/css/admin-nav.css @@ -19,7 +19,7 @@ text-decoration:none; font:bold 1em/1em Arial, Helvetica, sans-serif; text-transform:uppercase; - text-shadow: 2px 2px 2px #555; + /* text-shadow: 2px 2px 2px #555; */ } #nav li { @@ -46,7 +46,7 @@ text-decoration:none; font:bold 1em/1em Arial, Helvetica, sans-serif; text-transform:uppercase; - text-shadow: 2px 2px 2px #555; + /* text-shadow: 2px 2px 2px #555; */ } #nav a:hover { /* color:#fff; / * Use if bg is dark */ @@ -64,7 +64,7 @@ #contact #nav-contact a { background: #a9b0ba; /* Nav selected color */ /* color:#fff; / * Use if bg is dark */ - text-shadow:none; + /* text-shadow:none; */ } #home #nav-home a:hover, #create #nav-create a, diff --git a/static/css/style.css b/static/css/style.css index d00d8f4a6a0af59aecfa4f2c503f2a05b687ec13..377ebbc732dd14b6883aeb1928a581a99f346377 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -80,7 +80,7 @@ a.link, a, a.active { text-decoration:none; font:bold 1em/1em Arial, Helvetica, sans-serif; text-transform:uppercase; - text-shadow: 2px 2px 2px #555; + /* text-shadow: 2px 2px 2px #555; */ } #nav li { @@ -107,7 +107,7 @@ a.link, a, a.active { text-decoration:none; font:bold 1em/1em Arial, Helvetica, sans-serif; text-transform:uppercase; - text-shadow: 2px 2px 2px #555; + /* text-shadow: 2px 2px 2px #555; */ } #nav a:hover { /* color:#fff; / * Use if bg is dark */ @@ -125,7 +125,7 @@ a.link, a, a.active { #contact #nav-contact a { background: #a9b0ba; /* Nav selected color */ /* color:#fff; / * Use if bg is dark */ - text-shadow:none; + /* text-shadow:none; */ } #home #nav-home a:hover, #create #nav-create a,