add docstring for expect_json decorator

This commit is contained in:
Victor Shnayder
2012-11-19 09:10:02 -05:00
committed by Victor Shnayder
parent 5836438454
commit 9d8d6655c6

View File

@@ -4,6 +4,11 @@ import json
def expect_json(view_function):
"""
View decorator for simplifying handing of requests that expect json. If the request's
CONTENT_TYPE is application/json, parses the json dict from request.body, and updates
request.POST with the contents.
"""
@wraps(view_function)
def expect_json_with_cloned_request(request, *args, **kwargs):
# cdodge: fix postback errors in CMS. The POST 'content-type' header can include additional information