aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/decorators.py
diff options
context:
space:
mode:
authorxray7224 <jessica@megworld.co.uk>2013-07-11 20:55:08 +0100
committerxray7224 <jessica@megworld.co.uk>2013-07-11 20:55:08 +0100
commit49a47ec991152a5dd25a7460e1d3d11afb73d32d (patch)
tree34d6ad1a108b3b68f7c846900fb35f8add102daa /mediagoblin/decorators.py
parent1e2675b0c0ee2bf35705b538ec94978fe4f005d4 (diff)
downloadmediagoblin-49a47ec991152a5dd25a7460e1d3d11afb73d32d.tar.lz
mediagoblin-49a47ec991152a5dd25a7460e1d3d11afb73d32d.tar.xz
mediagoblin-49a47ec991152a5dd25a7460e1d3d11afb73d32d.zip
Ensures endpoint queries with @oauth_required are validated
Diffstat (limited to 'mediagoblin/decorators.py')
-rw-r--r--mediagoblin/decorators.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/mediagoblin/decorators.py b/mediagoblin/decorators.py
index ad36f376..bb2ba7a5 100644
--- a/mediagoblin/decorators.py
+++ b/mediagoblin/decorators.py
@@ -292,8 +292,10 @@ def oauth_required(controller):
body=request.get_data(),
headers=dict(request.headers),
)
- #print "[VALID] %s" % valid
- #print "[REQUEST] %s" % request
+
+ if not valid:
+ error = "Invalid oauth prarameter."
+ return json_response({"error": error}, status=400)
return controller(request, *args, **kwargs)