aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/plugins/api/tools.py
diff options
context:
space:
mode:
authorAditi <aditi.iitr@gmail.com>2013-08-22 22:34:06 +0530
committerAditi <aditi.iitr@gmail.com>2013-08-22 22:34:06 +0530
commit70cc6eb8f383dcc97aeac22216a9da0d65a09085 (patch)
tree7f9d646002f2e6db763b1b3e89d9762efb12a544 /mediagoblin/plugins/api/tools.py
parente018b2120ac4131afab6611c84f8cfbe0926e640 (diff)
parente7b8059f17c98ee88d933af52b0c4d858e882e8e (diff)
downloadmediagoblin-70cc6eb8f383dcc97aeac22216a9da0d65a09085.tar.lz
mediagoblin-70cc6eb8f383dcc97aeac22216a9da0d65a09085.tar.xz
mediagoblin-70cc6eb8f383dcc97aeac22216a9da0d65a09085.zip
Resolve merge conflict and merge.
Diffstat (limited to 'mediagoblin/plugins/api/tools.py')
-rw-r--r--mediagoblin/plugins/api/tools.py24
1 files changed, 0 insertions, 24 deletions
diff --git a/mediagoblin/plugins/api/tools.py b/mediagoblin/plugins/api/tools.py
index 92411f4b..d1b3ebb1 100644
--- a/mediagoblin/plugins/api/tools.py
+++ b/mediagoblin/plugins/api/tools.py
@@ -51,30 +51,6 @@ class Auth(object):
def __call__(self, request, *args, **kw):
raise NotImplemented()
-
-def json_response(serializable, _disable_cors=False, *args, **kw):
- '''
- Serializes a json objects and returns a werkzeug Response object with the
- serialized value as the response body and Content-Type: application/json.
-
- :param serializable: A json-serializable object
-
- Any extra arguments and keyword arguments are passed to the
- Response.__init__ method.
- '''
- response = Response(json.dumps(serializable), *args, content_type='application/json', **kw)
-
- if not _disable_cors:
- cors_headers = {
- 'Access-Control-Allow-Origin': '*',
- 'Access-Control-Allow-Methods': 'POST, GET, OPTIONS',
- 'Access-Control-Allow-Headers': 'Content-Type, X-Requested-With'}
- for key, value in cors_headers.iteritems():
- response.headers.set(key, value)
-
- return response
-
-
def get_entry_serializable(entry, urlgen):
'''
Returns a serializable dict() of a MediaEntry instance.